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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,2c6139ce13be9980 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,3d3f20d31be1c33a X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,2c6139ce13be9980 X-Google-Attributes: gid1108a1,public X-Google-Thread: f43e6,2c6139ce13be9980 X-Google-Attributes: gidf43e6,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Interface/Implementation (was Re: Design by Contract) Date: 1997/09/10 Message-ID: #1/1 X-Deja-AN: 271356465 References: <340C85CE.6F42@link.com> Organization: New York University Newsgroups: comp.object,comp.software-eng,comp.lang.ada,comp.lang.eiffel Date: 1997-09-10T00:00:00+00:00 List-Id: Patrick Doyle says <> Not at all, since we can't keep a whole big object in our heads, if we have to scan ahead to find information, we may easily have to do an exponential amount of scanning. On the way forward in a linear pass, we catalog and abstract and remember what needs to be remembered. When we scan forward, we are looking for a particular piece of information, and in general we don't know enough to catalog and abstract, even if we could keep this kind of non-linear scanning straight. Consider, in an Algol-68 program you see: int q = a * b; Contrast this to the Ada statement (Pascal, C, ... would be the same) Q : constant Integer := A * B; Now in the Ada case, you know you have seen A and B already, and hopefully the (more descriptive) names that are present will trigger the reference to your abstracted catalog gained by reading the text prior to this point and you will remember what you are looking for. If not, a simple search in reverse order from the point of reading will find the reference for you. But in Algol-68, you have to do a rather careful scan forward, paying careful attention to scope marks, to see if there are declarations of A and B in the same scope and this is a forward reference. You have to do this even if A and B are already declared, because normal block structure rules say that you get the innermost one. It is this kind of forward reference that the Ada design strenuously tries to avoid, since it greatly complicates the reading of a program. Worse, since people generally write linearly anyway, you get in the habit of reading linearly. When you see in an Algol-68 program int A; ... begin int B := A * 2; ... You will almost always just assume that the A is a backward reference to the declaration that preceded this. In the rare case where in fact there is another A ahead of you, you will risk making a significant mistake in understanding. Linear comprehension is a very important capability. All text books have indexes, which are of course functionally similar to hypretext links, but we do not say "never mind about presenting things in a logical order, building on what you have already presented, if you reference something ahead, people can just look it up in the index". Instead we expend a lot of effort to present things in a linear order (and indeed software for computing partial orderings of topics to create appropriate linear orderings is a standard part of the toolset for educators). I notice these days that people often create Hypertext documents that blatantly disregad this principle, and they are a huge pain to read. Sure this kind of organization is OK for reference or help material, but it is NOT the way to present a coherent body of knowledge that you expect people to acquire in a comprehensive manner. A lot of people complain that they get totally lost zooming around following links in a Hypertext document, and vey often they are actually not complaining about the paradigm at all, but rather its misuse to try to patch up poor document organization. Robert Dewar Ada Core Technologies