From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 14 Aug 91 20:15:52 GMT From: netcomsv!jls@apple.com (Jim Showalter) Subject: Re: c++ vs ada results Message-ID: <1991Aug14.201552.24023@netcom.COM> List-Id: smithd@software.org (Doug Smith) writes: >As an early attempt to use generics >for a library of reusable code, they have stood up very well. But >as an example of what can be accomplished with generics, they are >slightly dated. The C++ version benefitted from several years of 20-20 hindsight. What would be interesting to me would be for the Ada version to be rewritten using everything that has been learned about Ada and C++ in those years, and _then_ comparing them. I concede, however, that the result is still unlikely to be as dense as the C++ version, precisely because of the lack of inheritance. Consider, for example, what happens when you try to implement a singly-linked list generic and a doubly-linked list generic: since the data structures are fundamentally different, you wind up having to write two different packages even though they are quite similar in a variety of ways. On the other hand, this still isn't a truly fair comparison. The C++ version exploits both inheritance and genericity ("templates") to achieve its density. The Ada version has only genericity at its disposal, and so naturally comes up short (well, long--but you know what I mean). But consider this: many of the people who extoll the virtues of inheritance do so without taking genericity into account. My guess is that the C++ version written with inheritance but not templates would be about as cumbersome as the Ada version written with genericity but not inheritance. And I also think that both versions would be about the same size (within a small constant attributable to syntactical differences and naming conventions) if they were both written using inheritance and genericity. In sum, I think both of these features are important to a language. -- * Jim Showalter, software engineering consultant * * e-mail: jls@netcom.com * * voice : (408) 243-0630 * * data : (408) 984-5019 *