Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!jarthur!uunet!igor!rutabaga!jls From: jls@rutabaga.Rational.COM (Jim Showalter) Newsgroups: comp.object Subject: Re: Readability of Ada Message-ID: Date: 30 Apr 91 02:51:19 GMT References: <3878@ssc-bee.ssc-vax.UUCP> <20245@alice.att.com> <1991Apr23.193715.23815@odin.diku.dk> <1991Apr25.170356.21237@odin.diku.dk> <1991Apr28.053640.1650@odi.com> Sender: news@Rational.COM Lines: 64 ]>It's true that this is something that isn't supported in a good way in ]>C++. You have now demonstrated one (not "a large number of") example ]>of a problem with C++. I have demonstrated one simple form of inheritance that is not handled well by C++. The number of individual CASES that follow that form is essentially infinite. Last time I looked this qualified as a "large number". ]>So, what you have shown is that C++'s OOP is not perfect. It's still ]>a whole lot better than not having OOP at all. Is having support for what I call "special-case inheritance" good enough to get all hot and bothered about? I have no quarrel with the notion of inheritance, and I have no argument with the assertion that inheritance is useful. What I DO take exception to is the blind assumption that just because a language labels itself an OOP language it must by necessity then BE an OOP language. The support that C++ offers for inheritance is such that it works non-clumsily ONLY when all operations in derived classes are represented in the base class (although they can certainly be overridden in the derived classes). It falls over dead any time I want to subset or superset said operations, which turns out to be rather often. ]>You have not ]>demonstrated that "Ada's OOP is just as good as C++'s" or anything ]>like that. What I've demonstrated is that for a large number of inheritance problems it is just as easy to use Ada--which never even claimed to BE an OOP--as it is to use C++. >So you have shown that C++'s OOPS doesn't do everything that it ought >to be able to do in all cases. It's still true that C++ supports >inheritance far more than Ada does. First of all, see above. Second of all, are you aware that Ada support special-case inheritance directly via derived types? It may be slightly clumsier than in C++, but the support IS there, and it never ceases to amaze me that so many people have this notion that Ada has no such support at all. It aint exactly FORTRAN, you know... ]>The company I work for produces and sells an object-oriented database ]>system written in C++. I just counted the amount of code in it. This ]>is a based on a Unix "wc" count of only those files that we wrote from ]>scratch in C++, not counting any code we got from anywhere else even ]>if we modified it. The database system is currently at least 185,700 ]>lines of code, and the user interface tools and our C++-coded portable ]>user interface layer are about another 65,600 lines. I am personally ]>responsible for about 33,000 of those lines. Fine. Now--of that code, how much exploits inheritance? How much actually relies more on the strong typing, interface specification, and opaque types of C++? How much use do you make of exceptions and templates? In short, how much of the advantages you perceive from using C++ are due to its support for inheritance, and how much is due to its support for software engineering principles such as data abstraction and information hiding--support that is also robustly available in Ada, with far greater tool maturity? -- * "Beyond 100,000 lines of code, you should probably be coding in Ada." * * - P.J. Plauger, Convener and Secretary of the ANSI C Committee * * * * The opinions expressed herein are my own. *