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,f66d11aeda114c52 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,f66d11aeda114c52 X-Google-Attributes: gid103376,public From: paul.johnson@gecm.com (Paul Johnson) Subject: Re: Design By Contract Date: 1997/09/04 Message-ID: <5ulurp$aj8$1@miranda.gmrc.gecm.com>#1/1 X-Deja-AN: 269850661 Distribution: world References: Organization: GEC-Marconi Research Centre Newsgroups: comp.lang.ada,comp.lang.eiffel Date: 1997-09-04T00:00:00+00:00 List-Id: In article , jsa@alexandria.organon.com says... >I believe that it is possible to get a reasonable level of this >awareness without such "steeping" - as long as you are very careful >about not confusing explicit _features_ with the _expressivity_ of the >languages. One may have a specific feature for capability X while the >other achieves X by a nice little combination or particular >utilization of some other features or constructs. And, understanding >this is really the key to rational and (more or less) objective >language comparisons. These are wise words. On the other hand I would hold that a language with direct support for something is better for that thing than a language which requires some idiom. For example Eiffel has direct support for multiple inheritance (MI). Ada requires you to play games with generic parameters in order to achieve the same effect. Here are the reasons I dislike idiomatic programming: 1: Its harder to read. The reader must "reverse engineer" the design of the system by looking at the idiom and recognising it. This generally requires that the reader be familiar with the idiom in question. I recall being totally flumoxed when I was learning assembler and came across my first "JMP" instruction at the end of a routine. Later of course, I learned the trick and would now understand such code. 2: Its harder to optimise. I suspect that MI in Ada provides another good example here. In Eiffel the various jump tables needed for MI can be optimised, for example by eliminating duplication. As far as I can see you can't do that in Ada because the compiler does not have the necessary information about what the programmer is doing. (BTW, I would be very interested in more information about that last point). Of course, this on its own would be an argument for a very large and complex language with specific support for just about everything. This would be a bad thing: simplicity in language design is a Good Thing. OTOH learning an idiom is not really any different to learning a language feature. So the skill in language design and evaluation is in determining which constructs are so common or require such complex idioms that they should be supported directly by the language. IMNHO, MI is such a feature. Paul. -- Paul Johnson | GEC-Marconi Ltd is not responsible for my opinions. | +44 1245 242244 +-----------+-----------------------------------------+ Work: | You are lost in a twisty maze of little Home: | standards, all different.