[FIX][KCP] KCP-0112-FixCanUnderstand
Lothar Schenk
lothar.schenk at gmx.de
Mon Dec 15 16:00:24 UTC 2003
Am Montag, 15. Dezember 2003 13:16 schrieb Nathanael Schärli:
> In fact, there were dozens of places deep in the core of the system
> (e.g., in the Morphic framework) that caused a runtime error just
> because I was being a good programmer and actually declared abstract
> methods as 'subclassResponsibility', which is unarguably a good style of
> programming.
Whenever I hear someone say that something is "unarguably" so, it raises the
itch in me to argue. :)
Why is it 'unarguably' good style to fill abstract methods with the line "self
subclassResponsibility"? In the example of #close for a general stream, is
"self subclassResponsibility" an abstract formulation of the semantics of the
close operation? I don't think so. What if #close just contained a comment
"My subclass should implement this - do nothing"? Arguably, the trouble you
have with the semantics of #respondsTo: in dealing with such cases is a
consequence of putting something in these abstract methods which doesn't
really (semantically) belong there. Instances of the class actually respond
to #close, but the response is not meaningful in the given semantic context.
Lothar
"Walk this world with me"
More information about the Squeak-dev
mailing list
|