[squeak-dev] Future of Squeak, and outsider's view

David Goehrig dave at nexttolast.com
Mon Jun 29 19:43:06 UTC 2009


What I typically what I've
been doing to eliminate all of these methods with a single simple change:
Object
     doesNoUnderstand: aMessage
         ^ false

Occasionally, I'll add a line in there to log the message to a transcript
just to see if I'm doing something stupid, but 99.9 out of 100, the edit
time method checks are enough to catch most typo bugs.   Surprisingly
enough, this breaks incredibly little existing code, since anything that
would fire off the exception ends up user trapped  :)  And false is a pretty
good default, following the principle "when in doubt return false"!

Then again I also like replacing "respondsTo: canUnderstand: and
canPerform:" with a single "can:" method, because semantically they're all
asking the same basic question.  There's so much of the system that can be
refactored this way, where you have multiple methods with the same semantic
meaning but slight variations in implementation that you could squash the
vocabulary to a more manageable base with some careful thought.

Of course, I'm not married to a large existing code base :)

-- 
-=-=-=-=-=-=-=-=-=-=- http://blog.dloh.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20090629/1648f722/attachment.htm


More information about the Squeak-dev mailing list