Back to the issue... (was RE: Squeak coding style...)

Richard A. O'Keefe ok at cs.otago.ac.nz
Thu Mar 4 21:18:12 UTC 2004


The claim has been made that there are things (like HTML elements,
nodes representing lambda calculus) where you don't need class
comments for classes deeper in the hierarchy because everything is
adequately explained in superclasses.

However, precisely because "reading a Smalltalk program as an exploration",
you need the information *where you are*.  If I arrive at some method
DeepSubclass>>frob:by:ifBroken:
then
 - I need information about that method, and
 - I need information about that class.

One obvious tool would be a comment collector.
This would collect class comments from all the ancestral classes
into one TextMorph, so that I could see all the relevant comments
(class comments are supposed to explain the structure of classes)
at one time without having to clutter the screen up with half a
dozen browsers or lose my context in one browser.

Such is the power of Smalltalk that such a tool could be written in
an afternoon.  Alas, it's the first week of semester, and I've had a
couple of days off with a wrenched knee, and I have a paper to revise
for publication in the next hour and a half, so I shan't be able to
do it today.

Can we at least agree that every class which introduces an instance
variable or class variable should have a class comment explaining
that variable?  Unless everything the programmer needs to know about
it is really obvious in the name?  (And that includes when it may be
nil and when it may not...)



More information about the Squeak-dev mailing list