Eliminating assignments and variable syntax (accessors)
Andrew C. Greenberg
werdna at gate.net
Sat Aug 14 14:04:39 UTC 1999
>The reason, I think, would be the same as in Python: indented code
>is easier to read. I'm not saying that a decent indentation-based
>syntax exists for Smalltalk, but wouldn't it be nice? Currently,
>you can't *really* trust the indentation of code you are looking at,
>because the indentation cues might be wrong. You have to scan code
>character-by-character looking for delimeters.
So now the question remains, are there any other considerations that
must be weighed against such "ease of reading" in deciding between
one proposal or another? Consider, for example, "ease of learning,"
"ease of writing," and "ease of debugging."
In particular, Smalltalk has an awesomely simple syntax and
correspondingly simple semantics related to that syntax. Nearly
everything is a message. Accordingly, an analysis of "ease of
reading" for an indentation structure syntax for #ifTrue:#ifFalse:
must hold equally true for an indentation structure syntax for
#copyReplaceAll:with: and every other two-parameter keyword message,
or we must begin to invade the present syntax and semantics of the
language.
I agree that Python code has a versimilitude that, however stilted,
makes is somewhat "easier to read." I have also seen straightforward
and elegant Python code that could be made easier to read (IMHO)
somewhat stifled by the same indendation obligations. I'm not sure
that "easier to read" as used here is more than a matter of personal
taste.
Its for that reason that I was hoping we could, as a threshold
matter, come up with some objective criteria for making decisions.
More information about the Squeak-dev
mailing list
|