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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!sunic!ericom!eua.ericsson.se!euamts From: euamts@eua.ericsson.se (Mats Henricson) Newsgroups: comp.lang.ada Subject: Re: c++ vs ada results Message-ID: <1991Jun24.131612.17502@eua.ericsson.se> Date: 24 Jun 91 13:16:12 GMT References: <1991Jun12.164741.412@news.larc.nasa.gov> <1991Jun12.201740.16463@netcom.COM> <1991Jun16.041037.11606@kithrup.COM> <1991Jun18.041751.3740@netcom.COM> <1991Jun18.122812.18190@eua.ericsson.se> <3776@sirius.ucs.adelaide.edu.au> Sender: news@eua.ericsson.se Organization: Ellemtel Telecom Systems Labs, Stockholm, Sweden Nntp-Posting-Host: euas20c01.eua.ericsson.se List-Id: 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 started to see two different kinds of programmers in C++: >|> 1. Library designers >|> 2. Library users >|> >|> The first kind of programmers is doing some tricky nasty hacking behind the >|> scenes of the interface of the classes, to satisfy the second kind of users. >|> >|> 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 >|> >|> If you, on the other hand, have a well designed class library to build from, >|> I think C++ is a beautiful and easy language to use. >Yes, but writing libraries should not be so hard. It isn't in Ada. >You've really made a point in Ada's favour. To start with, I must admit that I haven't even seen one line of Ada code in my entire life. I know that is a weak point if you are discussing the pros and cons of C++ and Ada, but the thing is that I jumped into this discussion just to make a statement on what *I* think on the difficulties of writing code in C++. I think that depends on what kind of programmer you are (see above). I have written a string class consisting of 70 pages of code (including test code). I do not think that the actual writing was difficult, even though I of course had several bugs that was hard to find. After writing this class (it's actually two classes, along the main route of NIH, libg++ and the others) I learned more about library design from Mike Vilot, Jonathan Shopiro and Martin Carroll (courses). I now realize that just writing OK code is no big deal. Writing code that is optimal for many different users (see above) is HARD! If you claim that writing optimal component libraries in Ada is easy, I think you're wrong. I say this just from intuition, since I have no Ada experience. From what I have learned from programming, there is NO way you can make a language that makes it easy to do libraries. This is because library design is much a matter of design, i.e.: 1. What trade-offs are you taking (space/time) ? 2. Which kind of error-handling mechanism are you taking ? 3. Which features do you include in your code library ? 4. Which "class" is in charge in a complex UI-application ? 5. How do you avoid redundant code in your library ? 6. How do you achieve localized cost (you only pay for what you use) ? 7. How do you avoid complexity ? 8. How do you structure the library documentation ? Unless Ada is godsent (Something I doubt ;-) you have to wrestle with these questions when you write packages in Ada as well. Well, I suppose this is what I had to say... Mats Henricson