No Hungarian Notation in Smalltalk - was [KCP]
Event notification call for feedback
Michael Rueger
michael at squeakland.org
Tue Nov 4 15:27:31 UTC 2003
Brent Pinkney wrote:
> You are arguing that we should change the name of MessageNotUnderstood
> to MessageNotUnderstoodException or ExceptionMessageNotUnderstood.
> Surely by extension we chould change Integer to ClassInteger ans String
> to ClassString ?
No, because an the integer class is still about integers, whereas the
ClassRenameEvent is an even, not a class rename.
> Secondly, from an aeththesic perspective there is something elegant and
> colloqiual about
>
> [ x /y ] on: DivideByZero do: [ self inform: 'oops' ]
>
> that is lost if we decend into _CODE_ **
>
> [ x /y ] on: ExceptionDivideByZero do: [ self inform: 'oops' ]
Allow myself to differ here. If you read this aloud
[ x /y ] on: DivideByZeroException do: [ self inform: 'oops' ]
it speaks (small-talk) to you ;-)
That's why it *is* important to be very careful with names, that's where
I definitely agree with you.
> self triggerEvent: #renameClass
> with: (RenameClass class: aClass newName: aNewClassName).
The problem by leaving out the Event suffix is that you can't tell
whether RenameClass is the event or just the argument to an event
created in the triggerEvent method itself. In that sense the above code
is already duplicating semantics.
self triggerEvent: (RenameClassEvent class: aClass newName: aClassName)
or even
self trigger: (RenameClassEvent class: aClass newName: aClassName)
would avoid that.
Just my non-native TC ;-)
Michael
More information about the Squeak-dev
mailing list
|