DNU wording (was Re: Should every kernel class ...)

Klaus D. Witzel klaus.witzel at cobss.com
Mon Jan 22 12:00:21 UTC 2007


On Mon, 22 Jan 2007 11:47:55 +0100, Bert Freudenberg wrote:
> Am Jan 22, 2007 um 9:39  schrieb Klaus D. Witzel:
>> On Sun, 21 Jan 2007 21:23:54 +0100, Bert Freudenberg wrote:
>>> Maybe we could even reword the notice in the general  
>>> subclassResponsibility method. In general, Squeak error messages are  
>>> quite unhelpful. Like, the first thing everyone encounters is a DNU  
>>> for nil - the message could be way more informative.
>>
>> Also, agreed. Mind to sketch an example for the DNU text on nil, since  
>> I'm not sure that I understand what's wrong with the ages old DNU error  
>> text. Thank you.
>
> Well, newbies take the text literally. They wonder *why* UndefinedObject  
> does not understand the perfectly valid (because it exists in the  
> system) message.
>
> There are (at least) to obstacles to understanding here.
>
> Firstly, they focus on the message name, check for misspellings etc. It  
> does not even occur to them that it is not the *message* that is wrong,  
> but the *receiver*. But that is usually what went wrong. This applies to  
> all DNU's.
>
> In the special case of UndefinedObject DNU, it's totally non-obvious  
> that "UndefinedObject" has anything to do with "nil". And even if they  
> knew, they wonder how that thing could have *become* nil. Actually, most  
> often this is a strong hint that something was not initialized the way  
> it should have, but still *is* nil. This "gut feeling" is something you  
> only develop with experience. I doubt we could express this in the error  
> text ... although an "extended help" button might hint at it.

Yeah, *that* makes sense: a "what's up?" button or bubble-text, following  
the #explain idea but offering possible alternatives (nil versus #zork).  
Could be made available by the class side of exceptions, defaulting to  
"this is an exception for which I have as yet no explanation" ;-)

> Anyway, I'd argue that an error text more like "... is nil" would be way  
> more helpful, although technically of course it is not as accurate.

This can be let as is for the pros, IMHO :)

/Klaus

> - Bert -
>
>
>




More information about the Squeak-dev mailing list