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: Richard D Riehle Subject: Re: Ada OO Mechanism Date: 1999/05/25 Message-ID: <7ievk0$prt@sjx-ixn9.ix.netcom.com>#1/1 X-Deja-AN: 482023738 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> Organization: Netcom X-NETCOM-Date: Tue May 25 1:02:08 PM PDT 1999 Newsgroups: comp.lang.ada Date: 1999-05-25T13:02:08-07:00 List-Id: In article , Hyman Rosen wrote: >Once again, I will ask for an example demonstrating this, where >something is more complicated to use in C++ generics than in Ada. >This will make you the fourth person I have asked for this type >of example, the others being Richard D. Riehle, Samuel Mize, and >Robert Dewar. None of the others have chosen to post such an >example. I have a wonderful little proof that this is the case but this margin is too narrow for me to write it in its entirety. To paraphrase G.B. Shaw, "One an lay all the language advocates in the world end to end and still not reach a conclusion." There are certainly benefits to the C++ approach for generic programming, which is how Dr. Stroustrup refers to templates in his own book and how Ada refers to the same subject. There are also benefits to the Ada approach. There were inadequacies with the Ada model for generics before the addition of the "with package ..." construct. There were serious problems with C++ prior to adding the typename reserved word. Both languages are evolving. I prefer the Ada model for most designs. However, the syntax of C++ is a little more straightforward. The Ada syntax is designed to enforce a stricter set of type checking rules. C++ can also, in most but not all, cases do strict type checking. There are published examples of this. One of my favorite columns is in a magazine, C++ Report, called "Obfuscated C++." The monthly examples illustrate the central idea. Take any of the examples from that column and try to create equally obfuscated Ada. In fact, try to create an "obfuscated" Ada program. Pretty difficult (not impossible). I am not going to engage in dueling source code where anything I can play on my banjo you can play your guitar and Robert can play on his pipe organ. On the other hand, Tocatta and Fuge in D Minor is a bit of a stretch for my banjo and Foggy Mountain Breakdown sounds a little strange on the pipe organ. C++ is a great language for graphics and other stuff that is not safety-critical. It would seem to me, strange, to select it as the language for flight avionics, air traffic control, or other projects where human life is at stake. I know people do this, but knowing a little bit about both Ada and C++, I find it scary when someone decides to use C++ in this situation. On the other hand, for high-speed graphics where safety is not a factor, C++ might ] often be a better choice than Ada. Some instruments just do better for certain kinds of music. Richard Riehle richard@adaworks.com http://www.adaworks.com