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: Brian Rogoff Subject: Re: Ada OO Mechanism Date: 1999/05/25 Message-ID: #1/1 X-Deja-AN: 482168411 References: <7i05aq$rgl$1@news.orbitworld.net> <7i17gj$1u1k@news2.newsguy.com> <7icgkg$k4q$1@nnrp1.deja.com> <3749E9EC.2842436A@aasaa.ofe.org> <7id2eo$fag@drn.newsguy.com> <3749FF7D.F17CE16A@aasaa.ofe.org> <374AC676.F7AE0772@lmco.com> <7ieuja$5v9@news1.newsguy.com> Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: nntp1.ba.best.com 927689940 202 bpr@206.184.139.136 MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-05-25T00:00:00+00:00 List-Id: On 25 May 1999, Hyman Rosen wrote: > Samuel Mize writes: > > ... snip ... > > > Did you intend that paragraph to sound contentious? To my ear, > > at least, it has rather a "you're all liars, I'm naming names" > > sound to it -- I hope that isn't what you meant. > > I wanted it to sound somewhat contentious. The named people each > claimed in a posting that there were object-oriented techniques > that were harder, or less elegant, in C++ than in Ada. I asked > for examples with the thought that perhaps the posters didn't know > C++ as well as they knew Ada, and were therefore perhaps mistaken. > There were responses, but no code, so I got a little testy. I think its true that a lot of people have had this discussion a few times on c.l.a., so when someone mentions symmetric binary operators they imagine you've RTFM, or in this case the programming language FAQ, or the Rationale, or what have you. If you're interested in some other cases where the Ada mechanism is a little nicer, there are lots of examples of dispatching on function result that are easier, IMO of course, than the approaches in C++. Check out http://www.adahome.com/FAQ/programming.html#constructors http://stwi.weizmann.ac.il/g-cs/benari/articles/func.htm for examples. Another thing is that unless I'm missing something, C++ does not provide constrained genericity so you have to use workarounds like that in http://lazy.ton.tut.fi/~esap/instructive/simulating-constrained-genericity.html so your example Ada code that you wrote in another message is in fact a good example of a case where Ada is nicer :-) Incidentally, I tend to agree with you about automatic instantiation, and that was also discussed here. I tend to think that it shortens the code by eliminating noise instantiations, at least in quite a few examples I've seen. There are a number of things I like better about C++, though I think my "ideal" systems programming language would look mostly like Ada. -- Brian