[Squeakfoundation]Re: Class Comments
squeakfoundation@lists.squeakfoundation.org
squeakfoundation@lists.squeakfoundation.org
Sun, 21 Apr 2002 16:58:02 -0700
I recall being initially befuddled by the use of "I am..." statements in
class comments. I also vaguely recall part of the justification for
this approach being that the class name appearing only in code -the
class definition and instantiating,... code- allows for a very malleable
system. All the tools required for easily renaming a class are already
provided within the system. Embedding the class name in the class
comment would be undesirable since it would replicate that datum in a
non-code location which is NOT accessed by the provided code management
tools ('rename', 'all references',... .)
Now if a policy for including the class name in the class comment were
adopted along with good tools for keeping code and comments in synch
then this little argument would hold less weight. Just having tools and
policy for better integrating code and comments would be nice. :-)
One historical point I'm compelled to raise is that of the linguistic
context for the whole Smalltalk system. The choice of 'method' to
replace 'subroutine'/'function' was confusing in its day and yet
desirable for the sake of moving people out of one mode of thinking and
into another. The use of "accept" rather than "save" for telling the
'live' system to both Save and Include as part of yourself this chunk of
code was another -now seemingly quirky- choice made to convey what was
really going on and shift ones thinking. The use of "I am..." in class
comments was part of that same shifting. In a browser based environment
it made sense to have a class (which was a first class object) describe
itself (eg.'ClassDescription comment' messages the class
'ClassDescription' causing it to respond with a comment describing
itself.) This actually implied that in fact the class was a legitimate
entity unto itself and addressable in the same way as the system,
'Smalltalk', was addressable. It might seem quaint or even distracting
now, but it was part of the subversive language that was chosen on
purpose. Think in terms of objects as independent/interdependent
entities that do their own things. Quirky? Yes. When introduced was
it anymore difficult than grasping o-o concepts? No. Does it make as
much sense now as the new names for minor changes in
concept/implementation (eg. subroutine->method) ?
peace,
donald
P.S. As far as I know, at the time class comments were introduced the
idea of making comments (with templates non-the-less) an integral part
of the system was new and bizzar.