Why we should remove {} from Squeak
Andreas Raab
Andreas.Raab at gmx.de
Tue Oct 2 21:42:43 UTC 2001
Allen,
The following is a similar intellectual exercise since ANSI doesn't have {}
in it, so there's no real point arguing about it. But nevertheless...
> 1) {}'s encourage poor object-oriented programming style. Our
> experience has shown that many situations where dynamically
> constructed arrays are returned from a method, the programmer
> really should have defined a new class to represent the result.
This is certainly true. In almost all of these cases the programmer *should*
have defined one. But do you really think that abandonding {} will solve
this problem?! If not, then the argument is somewhat pointless, is it?! ;-)
It just trades a more useful construct for a less useful one...
> 2) The most common reasonable use of {}'s seems to be in
> grouping a set of similar items to be passed as a single
> method argument.
Yes, that's one of the major uses for it.
> This is really just a poor man's way to implement a variable
> length method argument list.
> There are interesting proposals that have been made for adding
> variable length argument lists to Smalltalk. If one of these were
> implemented, the more general {} construct would not be needed.
Might well be (incidentally, do you have pointers to these proposals)?! But
then again, I need to ask if abandoning {} has helped in any way to solve
this problem. As far as I am aware there's still no Smalltalk system that
has variable length arguments. So again, is there a point in abandoning a
useful construct if no alternatives are provided?! ;-)
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|