From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7a180be12347b9d3 X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,7a180be12347b9d3 X-Google-Attributes: gid1108a1,public X-Google-ArrivalTime: 2002-02-08 16:10:57 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada,comp.object Subject: Re: Merits of re-dispatching [LONG] Date: Fri, 8 Feb 2002 19:10:49 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <3c62524f.93369796@News.CIS.DFN.DE> <1013094178.985786@master.nyc.kbcfp.com> <3c6392e8.2400843@News.CIS.DFN.DE> <1013192956.289787@master.nyc.kbcfp.com> X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ada:19804 comp.object:33761 Date: 2002-02-08T19:10:49-05:00 List-Id: "Hyman Rosen" 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.)