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: 103376,e5eb8ca5dcea2827 X-Google-Attributes: gid103376,public From: Richard D Riehle Subject: Re: Ada OO Mechanism Date: 1999/06/01 Message-ID: <7ivi1v$6t6@sjx-ixn10.ix.netcom.com>#1/1 X-Deja-AN: 484306905 References: <7i05aq$rgl$1@news.orbitworld.net> <7i17gj$1u1k@news2.newsguy.com> <7icgkg$k4q$1@nnrp1.deja.com> <3749E9EC.2842436A@aasaa.ofe.org> <7id2eo$fag@drn.newsguy.com> <3749FF7D.F17CE16A@aasaa.ofe.org> <374AC676.F7AE0772@lmco.com> <374F1DD3.64070C3E@mitre.org> <7ircia$ued@drn.newsguy.com> Organization: Netcom X-NETCOM-Date: Mon May 31 7:54:55 PM PDT 1999 Newsgroups: comp.lang.ada Date: 1999-05-31T19:54:55-07:00 List-Id: In article <7ircia$ued@drn.newsguy.com>, chris@nospam wrote: >Today I saw a book on modula-3. > >I think Ada OO should have been designed as modula-3 OO is. Modula-3 has some interesting ideas that could contribute to future versions of Ada. However, Modula-3, in its effort to keep the language simple, falls a little short of the strong typing we expect of a well-designed Ada 95 program. >In Modula-3, you have a modula, which is same as an Ada package. Well, actually, not the same. There are some significant differences. Ada has a private part for the equivalent of an INTERFACE, and that increases the flexibility of the type model in terms of separate compilation of components of an implementation. One may reasonably criticize this feature as being excessively complex, but it does increase one's options in developing software with Ada. On the other hand, those added options do make the development of compilers more complex. The trade-off between compiler complexity and application programmer options raises issues that will not be easily agreed upon. >but also, you have what is called an OBJECT, (which looked >like a RECORD), which contains DATA part, and METHODS part. While the Modula-3 approach to this is a little safer than the equivalent in C++, it still has weaknesses. For example, if I understand correctly, there are still cases in which the compiler cannot determine if certain kinds of assignments are correct, and these can cause run-time faults. >Inside a modula, you can declare an OBJECT. > >So, here we have a language, which I thought was very similar to >Ada, but used the familiar class like construct for the OO type. Once again, we are seduced by the apparent simplicity of the type <=> module <=> class (OBJECT) On the surface, this simplicity is attractive. In practice, it leads to greater complexity than one might have expected. This is certainly the case in C++. Although I have not written Modula-3 programs, my reading of the language description makes me suspect that some of the same problems from C++ will manifest themselves. >I have no idea why Ada did not do it the same way. I wonder if when >Ada95 OO was designed, if modula-3 was around? The designers of Ada 95 knew about Modula-3. The philosophy of the two languages is different. Those who favor Modula-3 (I know some of them) tend to believe Ada is too full of features and favor a smaller language definition. For example, one author says "The rules associated with Ada generics are too complicated for our taste." However, it is that set of rules that helps give Ada is unparalleled power in designing compile-time checked, generic reusable components. >I liked the way modula-3 did it. I think I am going to learn more >about that language. Too bad it is not a very much used language. Please do learn Modula-3 as thoroughly as possible. Then return to your assessment of Ada 95. You may find yourself more charitable toward Ada. The design of Ada was not a process of overlooking other language designs. It included careful analysis of what other languages had to offer. In fact, this one of the benefits of Ada 95 following the design of other languages. The architects and reviewers of Ada 95 had the opportunity to evaluate how well certain features worked in other languages and the option to incorporate those that seemed appropriate into the Ada language design. The decision to design Ada 95 as it is designed was a deliberate choice, for well-taken technical reasons. One may disagree with those technical reasons, but they are as valid, in the end, as other choices that might have been made. Richard Riehle richard@adaworks.com http://www.adaworks.com