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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e5eb8ca5dcea2827 X-Google-Attributes: gid103376,public From: Hyman Rosen Subject: Re: Ada OO Mechanism Date: 1999/06/01 Message-ID: #1/1 X-Deja-AN: 484528820 Sender: hymie@calumny.jyacc.com References: <7i05aq$rgl$1@news.orbitworld.net> <7i17gj$1u1k@news2.newsguy.com> <7iems7$1vm@news2.newsguy.com> <86iu9fhawg.fsf@ppp-101-91.villette.club-internet.fr> <86k8ttqgia.fsf@ppp-159-70.villette.club-internet.fr> X-Complaints-To: abuse@panix.com X-Trace: news.panix.com 928257367 26320 209.49.126.226 (1 Jun 1999 17:16:07 GMT) Organization: PANIX Public Access Internet and UNIX, NYC NNTP-Posting-Date: 1 Jun 1999 17:16:07 GMT Newsgroups: comp.lang.ada Date: 1999-06-01T17:16:07+00:00 List-Id: Laurent Guerby writes: > If I understand the rest of your posting, the C++ approach is "if it > links, it works". You have to wait the linker to complain about > mangled symbols not to be there to have the pleasure of trying to find > out where you messed up your template ;-). You give source code to the compiler, and it gives you either a working executable, or a set of error messages explaining why it was unable to do so. Internal phases of the compiler's operation are not of interest to its user. If the error messages are unintelligible, then that is the fault of the compiler author. > Strange, I would say that in Ada you doesn't have to know > "exactly what's going on with the code" inside your generic > to use and compile things, whereas in C++ you have to > see the template code to see if your parameters will > work. That's breaking some abstraction. In C++ you generally rely upon documentation of the template parameters instead of actual restrictions, although it's possible to code those if you want to. The C++ Standard has a vocabulary of some typical examples (copy constructable, forward iterator, etc.). > In Ada: "if it compiles against the spec it works, regardless of the > implementation". This favour distributed team work, properly > abstracted generic specs and so ease build large reliable stuff. Probably so. > Interesting ;-). Also Ada programmers tend to have big generic > contracts (read lots of template arguments), I think the C++ notation > will tend to be cumbersome if one complex template instanciation type > is used a lot (well, you can #define then ;-). You would use a typedef, not a #define. And most templates I've seen have few parameters. Those with somewhat more tend to default the later ones so that they may be elided. > That was my point, unless you put everyting in a big C++ source file > you cannot build statically (at elaboration time in the Ada world) > complex objects implying multiple classes. I'm not sure what you mean here - an example would be useful. > BTW, thanks for bringing your C++ expertise on us poor Ada guyes, I > really find your posts insightful on a lot of issues ;-). I have never called anyone a "poor Ada guy", nor have I stated that C++ is a better language than Ada.