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.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!uokmax!munnari.oz.au!yoyo.aarnet.edu.au!sirius.ucs.adelaide.edu.au!chook!andrewd From: andrewd@chook.adelaide.edu.au (Andrew Dunstan) Newsgroups: comp.lang.ada Subject: Re: c++ vs ada results Message-ID: <3812@sirius.ucs.adelaide.edu.au> Date: 26 Jun 91 01:26:02 GMT References: <1991Jun18.041751.3740@netcom.COM> <1991Jun18.122812.18190@eua.ericsson.se> <3776@sirius.ucs.adelaide.edu.au> <1991Jun25.002928.16897@eve.wright.edu> Sender: news@ucs.adelaide.edu.au Reply-To: andrewd@chook.adelaide.edu.au (Andrew Dunstan) Nntp-Posting-Host: chook.ua.oz.au List-Id: In article <1991Jun25.002928.16897@eve.wright.edu>, tmcclory@eve.wright.edu (Tom McClory) writes: |> 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. |> I looked again and saw that Mats was talking about "producing code", not design. Of course, there are language-independent aspects of programming, particularly in abstract design. These are often very difficult, but the issue in this discussion has been C++ vs. Ada. That was what I was dealing with. |> 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. |> See above. I haven't read the book, but I will try to get a copy! |> 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. I have read this and used a few of the tools. It has a useful set of tools, but there is just something about it that occasionally annoys me. Maybe it's just that I don't like identifiers like the_small_brown_dog_with_a_broken_left_front_leg! :-) Seriously, what I find disconcerting is that his abstractions have a strange feel to them. They don't reflect the way I think about objects, so using them is a bit too much of an effort. (This is an important issue in program/library design!) |> 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. I agree that garbage collection is a serious issue, and must be dealt with promptly and effectively by compiler vendors. It is not good enough any more to have vendors taking advantage of the "option" in the standard. This is an example of a fundamental issue in language design. How much, and what, do we leave up to the programmer, and how much and what do we take care of in the run-time system of the language. Which seems to get us back to where we started! ####################################################################### # Andrew Dunstan # There's nothing good or bad # # Department of Computer Science # but thinking makes it so. # # University of Adelaide # # # South Australia # - Shakespeare # # net: andrewd@cs.adelaide.edu.au # # #######################################################################