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

Bert Freudenberg bert at freudenbergs.de
Mon Jan 22 10:47:55 UTC 2007


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.

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.

- Bert -





More information about the Squeak-dev mailing list