Path: utzoo!attcan!uunet!husc6!bloom-beacon!mit-eddie!uw-beaver!tektronix!tekcrl!jans
From: jans@tekcrl.TEK.COM (Jan Steinman)
Newsgroups: comp.lang.smalltalk
Subject: Re: Is SELF a naughty OOP construct?
Message-ID: <2692@tekcrl.TEK.COM>
Date: 31 May 88 22:01:03 GMT
Organization: Tektronix Inc., Beaverton, Or.
Lines: 24



Quite the contrary!  When I'm reviewing code, a little flag goes up in my head 
whenever I see methods that do not refer to "self".  I then start looking for 
who is getting all the terminal messages -- if 60% of them are going to one 
object, for instance aStream, I think to myself, "Hmm.  This method really 
belongs in Stream!"

There is also a strong movement toward more use of accessing protocol as a way 
of enhancing inheritance, which would be impossible without the use of "self".  
The fact that  "self" refers to the receiver rather than the implementor makes 
it rather non-analogous to your GOTO example -- "self" more closely resembles 
the oft desired COMEFROM in its actions!

I agree fully with Brian (op cit) that "super" is a much less tidy concept, and 
also submit another more deserving of scorn than "self": "thisContext".  It is 
something one either hates or loves, depending on whether one is trying to 
understand someone else's code, or is attempting to do some tricky hackery.

:::::: Software Productivity Technologies -- Experiment Manager Project ::::::
:::::: Jan Steinman N7JDB	Box 500, MS 50-383	(w)503/627-5881 ::::::
:::::: jans@tekcrl.TEK.COM	Beaverton, OR 97077	(h)503/657-7703 ::::::