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 18:25:54 GMT From: haven.umd.edu!uvaarpa!software.org!smithd@purdue.edu (Doug Smith) Subject: Re: c++ vs ada results Message-ID: <1991Aug14.182554.16576@software.org> List-Id: In article <1991Aug14.050358.19787@beaver.cs.washington.edu> mfeldman@june.cs.w ashington.edu (Mike Feldman) writes: > In article <1991Aug13.142900.28910@slcs.slb.com> cornish@slcs.slb.com (Darryl Cornish) writes: > > > >Grady Booch converted the Booch Ada Component Library from ADA to C++. > >The result was thaty 150,000 lines of ADA became 20,000 lines of C++. > > > > Also I wonder if coding style made any difference. Perhaps Booch adopted a > more concise style in the C++ version. I have not seen the C++ version. > Booch's Ada components are, IMHO, rather excessively verbose, especially > as to extra-long names, which of course make the total LOC higher. > > I don't want to get into language wars here, just to be certain we are > comparing the versions on a level playing field. Assuming that there were > inherent aspects of C++ that allowed more concise coding - and not just a > different lexical convention, for example - then it would be interesting > to know what these aspects were. Maybe Grady will respond himself? > > Mike There are several ways that the Booch Components use generics that create an excessive amount of code. 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. As relates to this thread, there is excessive duplication of code to handle the same algorithms. For example, several of the generics that use linked list implement traversing, constructing, etc. similarly. It is possible to take an algorithmic approach to building these utilities. This creates a smaller library of generics that provide the same capabilities. If my memory serves, a conservative estimate was a reduction from 1000+ to about 150 generic packages. I would also predict an increase in the number of utilities that could be constructed from the 150 generics. Although I did not attempt to convert the Booch library to an algorithmic approach, I did build a memory management library which consisted of 8 packages (2 + 3 + 3) that could construct 18 (2 * 3 * 3) utilities. They were used on a project and worked fine.