Need feedback on simple idea

Adam Spitz aspitz at student.math.uwaterloo.ca
Thu Apr 10 14:13:37 UTC 2003


Jon Hylands wrote:

> Well, personally, I have no interest at all in pursuing this. I very much
> like the fact that instance variables are private in Smalltalk.
> 
> And no, I'm not a Java/C++ person -- I've never used either language at
> all, and I've been using Smalltalk since 1987.

Sorry. :) I didn't mean that to sound insulting. I think the Java
culture takes privacy way too far, but I do understand that there are
middle grounds.


> Personally, I think the loss of being able to use instance variable names
> as method names more than offsets any increase in apparent simplicity and
> uniformity.

Interesting. When do you use methods with the same names as instance
variables? The only time I can think of is when I want to do some sort
of lazy initialization thing, but then I think that the code
communicates better if I call the variable something like
"cachedWobulator" instead of just "wobulator".

I like the idea that an object is just something that responds to
messages; it bothers me, at some weird aesthetic level, that accessing
instance variables is different. At a more practical level, it bothers
me that I should have to think about whether to use "accessor methods"
or not. And at a completely superficial level, it really bugs me to see
the word "self" spewed all over my code. ;)


Adam Spitz



More information about the Squeak-dev mailing list