|
Boost : |
From: Dave Gomboc (dave_at_[hidden])
Date: 2001-11-26 01:37:33
> >Of course they all do the same thing, so we only need one of these -
it
> >depends on which way you look at it I guess - personally I prefer
> >"is_public_base", as it's the easiest to understand what it does (I
always
> >get "superclass" and "subclass" mixed up, and I'm sure I'm not
alone!)
>
> But it's easy. As you draw the inheritance hierarchy, superclasses
come
> above subclasses. That's how I remember it :o).
That depends on how you draw the diagram, doesn't it? Don't trees grow
upward? :-)
It's not at all uncommon for people to be confused re: which class is
the superclass, and which is the subclass. Many who don't know the
definitions reason that because the base class has less functionality
than the derived class, the base class is the subclass, and the derived
class is the superclass. The super/sub-class terminology actively works
against some people's expectations; I've found it best to avoid these
terms. I recommend using ancestor and descendent -- nobody gets
confused with those.
Perhaps "is_public_base" doesn't quite make it obvious which is which,
but "SUPERSUBCLASS" is certainly no improvement, for the reason
described above. "is_public_base_of" looks good to me, since the
ordering of the arguments is more clearly implied. Of course, infix
would be ideal.
Dave Gomboc
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk