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=0.2 required=5.0 tests=BAYES_00,HK_RANDOM_FROM, INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!sdd.hp.com!caen!malgudi!uoft02.utoledo.edu!eve.wright.edu!tmcclory From: tmcclory@eve.wright.edu (Tom McClory) Newsgroups: comp.lang.ada Subject: Re: c++ vs ada results Summary: Reusable code ain't easy in Ada Message-ID: <1991Jun25.002928.16897@eve.wright.edu> Date: 25 Jun 91 04:29:31 GMT References: <1991Jun18.041751.3740@netcom.COM> <1991Jun18.122812.18190@eua.ericsson.se> <3776@sirius.ucs.adelaide.edu.au> Organization: Wright State University Nntp-Posting-Host: eve.wright.edu List-Id: In article <3776@sirius.ucs.adelaide.edu.au> andrewd@chook.adelaide.edu.au (Andrew Dunstan) writes: >In article <1991Jun18.122812.18190@eua.ericsson.se>, >euamts@eua.ericsson.se (Mats Henricson) writes: > >|> I have so far only done programming as a library designer, and I think that >|> is *VERY* difficult if you try to produce code that is: >|> a) fast >|> b) not wasting memory >|> c) usable >|> d) reusable (in terms of subclasses) >|> e) etc >|> f) etc >|> g) etc >|> > >Yes, but writing libraries should not be so hard. It isn't in Ada. >You've really made a point in Ada's favour. > I strongly disagree with Andrew Dunstan that "writing" reusable libraries is any easier in Ada than other languages. The issue isn't the coding, but the designing. Writing truly reusable libraries that balance the conflicting tradeoffs Mats Henricson describes is a very difficult design problem that is independent of the programming language used. Grady Booch in his recent book _Object_Oriented_Design_ does a very nice job explaining why. As an example of how difficult writing such libraries are, even in Ada, check out the book _Software_Components_with_Ada_ also written by Booch. It is very evident that much thought, talent, and experience went into designing a collection of reusable data structures and common utilities. The data structures in his book, linked lists, queues, stacks, trees, graphs, etc. are the stuff most data structures course are made of. But designing for introduces many more important design decisions as Mats Henricson notes. In fact, it can be argued that since it is optional for compiler vendors to implement garbage collection in the compiler runtime support, designing reusable components for Ada is *more* difficult. Any component that creates and destroys many instances during execution must itself perform the garbage collection. The designer of such a component must take this into account during design and during implementation. All "object oriented" languages I'm familiar with (Smalltalk, C++, Eiffel) provide garbage collection to remove this burden from the programmer. Regards, Tom McClory