No Hungarian Notation in Smalltalk
Doug Way
dway at riskmetrics.com
Tue Nov 4 18:51:13 UTC 2003
Brent Pinkney wrote:
> ...
> It is precicely because Roel's System Change events are _probably_
> going to be included in the base image, that we thrash out and firmly
> establish the naming convention we would like to see observed in Squeak.
>
> As I have explained and illustrated, and you and others previously
> concurred, the tradition is to avoid prefixes or suffixes.
>
> However, disambiguation of more optional classes is a separate
> unrelated issue and for that reason there already exists the Prefix
> Registry page on the Swiki reserve such prefixes.
>
> As illustrated, one of the de-facto standards is to avoid the Hungrian
> convention of including implementation type in the name. So even if I
> have a new Event subclass to capture the ocurrence of a flower
> blossoming in package BloemStuff, its name would be BloemFlowerBlossom
> and not BloemFlowerBlossomEvent or BloemEventFlowerBlossom.
I agree 100% that we don't need to have prefixes and suffixes in
base-image class names for namespace reasons.
However, some suffixes are arguably useful as simply a more descriptive
class name, even if they might be a bit redundant with regard to a
superclass name. For example, BorderedMorph is a subclass of Morph.
You could argue that it should just be called Bordered, but that seems
less readable to me. I think of it as a "bordered morph", not just a
"bordered". (A noun suffix (e.g. "Morph") is especially helpful if the
class would otherwise not be a noun (e.g. "Bordered").)
So in that sense, perhaps Roel's naming of classes with an "Event"
suffix is perfectly fine.
- Doug
More information about the Squeak-dev
mailing list
|