comp.lang.ada
 help / color / mirror / Atom feed
From: "Matthew Heaney" <mheaney@on2.com>
Subject: Re: Merits of re-dispatching [LONG]
Date: Fri, 8 Feb 2002 19:10:49 -0500
Date: 2002-02-08T19:10:49-05:00	[thread overview]
Message-ID: <u68q8g1kt5sl1d@corp.supernews.com> (raw)
In-Reply-To: 1013192956.289787@master.nyc.kbcfp.com


"Hyman Rosen" <hyrosen@mail.com> wrote in message
news:1013192956.289787@master.nyc.kbcfp.com...
> This is an incorrect view of what is happening.

Yes, we all know this is an incorrect view.  But the programmer has to learn
that this view is not the correct view.  He learns it because something
doesn't work the way he expects.

You learn by forming a mental model of how something works, and then testing
that model via experience.  When something behaves in a way that is
inconsistent with your model, then your model has been falsified, and you
have to change it so that there are no more surprises (you can make accurate
predications).

The issue in C++ is that when programmers first learn that language, they
very naturally form a mental model that says, "when I call a virtual member
function (through a ref or ptr, which may be implicit), the call is
dynamically bound."  This model is very successful at making accurate
predications.

However, in a dtor, the language behaves in a way that is inconsistant with
this otherwise good model of reality.  Once you learn why, then the fact
that it does behave that way makes sense, but it does surprise programmers.

The whole issue of "affordance" in user interface design concerns exactly
this issue.  When you use a tool, you form a mental model what to do to make
a certain thing happen.  But when you use the tool, and it fails to do what
you expect, then you are naturally surprised.  Good user interfaces are
designed to that the user is never surprised.

Ada95 has a flaw here: predefined equality "reemerges" when the type is
passed as a generic formal type, and when it's the component of a composite
type.  If you've overriden predefined equality for a type, this is *never*
what you expect.  (You naturally assume that your overridden operator is
that one that will be called, but it isn't, and this is a surprise.  From a
human engineering point of view, this is a flaw.)







  reply	other threads:[~2002-02-09  0:10 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-07 10:26 Merits of re-dispatching [LONG] Dmitry A. Kazakov
2002-02-07 15:03 ` Hyman Rosen
2002-02-08  1:29   ` Matthew Heaney
2002-02-08  9:16     ` Dmitry A. Kazakov
2002-02-08 18:30       ` Hyman Rosen
2002-02-09  0:10         ` Matthew Heaney [this message]
2002-02-12  8:32         ` Dmitry A. Kazakov
2002-02-12 21:37           ` Hyman Rosen
2002-02-13  9:29             ` Dmitry A. Kazakov
2002-02-13 14:32               ` Hyman Rosen
2002-02-13 19:58           ` Dave Harris
2002-02-14 15:06             ` Dmitry A. Kazakov
2002-02-16 12:10               ` Dave Harris
2002-02-18  8:57                 ` Dmitry A. Kazakov
2002-02-18 19:47                   ` Merits of re-dispatching Dave Harris
2002-02-19  9:20                     ` Dmitry A. Kazakov
2002-02-21  5:49                       ` Hyman Rosen
2002-02-21  9:04                         ` Dmitry A. Kazakov
2002-02-21 18:17                           ` Hyman Rosen
2002-02-22  9:21                             ` Dmitry A. Kazakov
2002-02-22 16:59                               ` Hyman Rosen
2002-02-25  8:51                                 ` Dmitry A. Kazakov
2002-02-08 23:51       ` Merits of re-dispatching [LONG] Matthew Heaney
2002-02-12  9:02         ` Dmitry A. Kazakov
2002-02-07 23:40 ` Nick Roberts
2002-02-08  8:56   ` Dmitry A. Kazakov
2002-02-08  1:06 ` Matthew Heaney
2002-02-08  9:48   ` Dmitry A. Kazakov
2002-02-09  0:16     ` Matthew Heaney
2002-02-08 18:10   ` Hyman Rosen
2002-02-09  0:41     ` Matthew Heaney
2002-02-08 18:33 ` Nick Roberts
2002-02-09  4:07   ` Nick Roberts
2002-02-12 10:13   ` Dmitry A. Kazakov
2002-02-14 20:57 ` Tucker Taft
2002-02-15 15:43   ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox