From: donh@syd.csa.com.au (Don Harrison)
Subject: Re: Real OO (was Choice of OO primitives in Ada95)
Date: 1996/03/15
Date: 1996-03-15T00:00:00+00:00 [thread overview]
Message-ID: <DoAo6J.7A6@assip.csasyd.oz> (raw)
In-Reply-To: Do7uyC.4K2@world.std.com
Robert A Duff writes:
:In article <DnKnsz.C8C@assip.csasyd.oz>,
:Don Harrison <donh@syd.csa.com.au> wrote:
:>The only 'cost' is the effort of writing them in the first place but the benefit
:>is enormous because that correctness is propagated through reuse. When assertions
:>are used, there is nothing to fear from inheritance and no reason why all
:>abstractions should not be candidates for reuse by inheritance.
:
:Well, assertions are a nice feature of Eiffel, but they don't
:*guarantee* correctness. For example, there are some things that can't
:be formalized, like "this procedure prints an error message that is
:easily understood by any competent user". That's why Eiffel allows some
:assertions to be merely comments, and of course if it's just a comment,
:you can't know for sure that it's obeyed, unless you look at every
:overriding.
Granted. Not everything can be formalised. Of course, it's clearly valuable to
exploit those aspects of a design that may be formalised.
:>In contrast, assertion-less inheritance propagates errors through reuse.
:>
:>'Frozen' is used when the designer knows the implementation will not change.
:>
:>: Of course, the counter-argument is that you don't always know ahead of
:>: time when you might need dispatching.
:>
:>Exactly.
:>
:>: I'm not sure I agree with Ray Toal, though, that requiring "tagged" is a
:>: Good Thing. Even without that rule, Ada still gives you control over
:>: whether things dispatch, on a call-by-call basis. So, I view "tagged"
:>: as simply an efficiency hack. Efficiency is a Good Thing, too, though.
:>
:>Efficiency hack is a good way of describing it.
:
:Would you say "frozen" is (merely) an efficiency hack? I view it as
:partly an efficiency hack, and partly an aid to understanding the
:program.
The two are different in a couple of ways:
a) purpose - 'tagged' concerns dispatching whereas 'frozen' concerns redefinition
b) syntactic necessity
- 'tagged' is not necessary if the language allows dispatching by default.
It is necessary, if dispatching is optional, as in Ada for the purpose of
efficiency.
[I happen to think dispatching by default would be better because the human
benefits of flexibility and simplicity would outweigh the cost of bigger and
better hardware].
- 'frozen' is necessary to indicate whether an operation may be redefined
(which is not related to efficiency).
:- Bob
Don.
next parent reply other threads:[~1996-03-15 0:00 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Do7uyC.4K2@world.std.com>
1996-03-15 0:00 ` Don Harrison [this message]
[not found] <Do7unJ.1sq@world.std.com>
1996-03-15 0:00 ` Real OO (was Choice of OO primitives in Ada95) Don Harrison
1996-02-22 0:00 Jean-Pierre Rosen
1996-02-22 0:00 ` Spencer Allain
1996-02-22 0:00 ` Valery Croizier
1996-02-24 0:00 ` Robert A Duff
1996-02-22 0:00 ` Matt Kennel
1996-02-23 0:00 ` Robert A Duff
1996-02-23 0:00 ` Jon S Anthony
-- strict thread matches above, loose matches on Subject: below --
1996-02-20 0:00 Choice of OO primitives in Ada95 Jon S Anthony
1996-02-22 0:00 ` Real OO (was Choice of OO primitives in Ada95) Don Harrison
1996-02-22 0:00 ` Robert Dewar
1996-02-23 0:00 ` Gene Ouye
1996-02-26 0:00 ` James O'Connor
1996-02-26 0:00 ` Gene Ouye
1996-02-22 0:00 ` Jon S Anthony
1996-02-24 0:00 ` Valery Croizier
1996-02-24 0:00 ` Robert A Duff
1996-02-26 0:00 ` Matthew B. Kennel
1996-02-26 0:00 ` Don Harrison
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox