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

Lex Spoon lex at cc.gatech.edu
Fri Mar 5 04:49:20 UTC 2004


"Richard A. O'Keefe" <ok at cs.otago.ac.nz> wrote:
> 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

Did you know that there are tools in Squeak already for these directions
of exploration?  They aren't the single step that your comment collector
would be, but they are still fairly efficient, and they do allow some
extra stuff in addition to looking at comments.

For looking at class comments, you can use the hierarchy browser.  Point
to a class in a browser, bring up the yellow-button menu, and choose
"browse hierarchy".  You can then browse all the superclass--and
subclasses--of a particular class.  If you click the "?" button it will
have the decency to stay clicked, so that you can browse just the
comments if you want.

Similarly, if you do "inheritance" while looking at a menu, or if you
press the "inheritance" button in a browser, then you can look at a
method plus all the methods it overrides.  Thus if you start out looking
at SkipList>>do:, you can quickly browse to Collection>>do: and see what
the general definition of the method is.  (In fact, this is a good
example -- try it!  SkipList's do: has no comment....)

(Ahem, *nothing* in SkipList has a comment!  Anyone want to document
this a little?  I bet the original changeset had a good description that
could be pasted in as the comment.)

It really is worth looking at all the menu items in each pane of the
browser.  There is a LOT of good stuff hidden in there that can speed up
code traversal.

-Lex



More information about the Squeak-dev mailing list