[Q] Subclassing. was: Making a button immune...

Sean Charles scharles at nildram.co.uk
Sun Apr 14 17:05:21 UTC 2002


Martin,

> That brings up another question: I frequently hesitate to create a new
> class, especially if it is only for "internal" reasons. Maybe I should
> just go ahead.

I hit this mindset a good while ago and now, if I can't find what I want
within ten minutes of using the method finder, then it probably isn't there
and I write what I need using what else I find or from scratch. Sometimes
this backfires when you later find what you where looking for only it was
called something else. I can recall this happening to me several times yet I
can't seem to remember where...which kind of brings me to what I consider
the biggest obstacle to learning Squeak, at least from my own personal
experience.

It's the sheer volume of classes and functional diversity of same that comes
with Squeak that IMHO, makes the learning curve quite steep. When I
downloaded 2.7 for the first time I couldn't believe how many classes there
were! The 'Smalltalk the language' learning curve is incredibly short (five
reserved words, everything is an object, receivers and messages) compared to
the time it takes to become familiar with other languages, but it's learning
what the class library provides, regardless of environment whether it be
C/C++/Java/Scheme/whatever, that really 'makes' an effective hacker...once
you know what's there to be used and abused then you can be *really*
productive. I can remember spending countless hours just reading sometimes
and not really achieving much...although now looking back it was very good
practice and I'm glad I stuck with it.

>
> OTOH there is some good reason behind my hesitation: for another
> person it will not be obvious which classes are ment for public use
> and which are for internal use.
>
No prisoners! Use it or lose it I say! Caveat hacker!!

> Now you may argue that every class is for public use, but still:
> seeing a screw and a car engine on the same parts list may make the
> list hard to read, especially when there are many more screws than car
> engines on the list and you really are interested in the car engines
> only.
> Is there a solution for that ?
>
I think what you are hinting at *might* be this work by Robert Hirschfeld at
http://www.prakinf.tu-ilmenau.de/~hirsch/Projects/Squeak/AspectS/. Maybe!?

FAILED IDEA...
One idea I had in times past was to add something to the Object class to
record each time a particular class was the target of the 'find class...'
action. In a classroom environment you would be able to build up a profile
of those classes that might benefit from being better documented based on
most recently visited. It's a failed idea for me because now I am familiar
enough with it all not to be bothered that much anymore!

Sean.





More information about the Squeak-dev mailing list