when should sends be virtual?
Mario.Wolczko at Eng.Sun.COM
Thu Jan 19 08:36:32 UTC 1995
Just a few comments to add to the discussion.
I think the issue of whether you leave everything open to change in
descendants vs trying to anticipate which things might be overridden
is a semi-religious issue. There are two schools of thought, and no
clear evidence suggesting that one is best under all circumstances.
However, if your aim is to support rapid prototyping, it seems clear
that openness is better. It may be that for long-term stability of
systems, the alternative point of view works better. In any case, I
believe it would be quite straightforward in Self to build support for
closed interfaces, within the programming environment, without
modifying the language semantics.
> another aspect of virtual methods being the default is speed. considering
> this, i don't understand why it is as it is when one of the original design
> goals was speed.
Speed was most certainly *not* one of the original design goals. Back
in 1986 nobody would have believed that efficient implementations of
Self could be built. And in fact the penalty for ubiquitous dynamic
binding is quite low -- see Urs Hoelzle's PhD thesis for details.
> (would YOU want to allow your
> child to alter your behavior? ;-) another definition might be
I think the world would be a much better place if every person had the
opportunity to rectify the failings of their ancestors :-)
More information about the Self-interest