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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fc52c633190162e0 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!newscon02.news.prodigy.net!prodigy.net!newsdst01.news.prodigy.net!prodigy.com!postmaster.news.prodigy.com!newssvr23.news.prodigy.net.POSTED!4988f22a!not-for-mail From: Newsgroups: comp.lang.ada References: <1172144043.746296.44680@m58g2000cwm.googlegroups.com> <1172161751.573558.24140@h3g2000cwc.googlegroups.com> <546qkhF1tr7dtU1@mid.individual.net> <5ZULh.48$YL5.40@newssvr29.news.prodigy.net> <1175215906.645110.217810@e65g2000hsc.googlegroups.com> <1175230700.925143.28490@n59g2000hsh.googlegroups.com> <1btkgzzj6zimp.acsq8mkzqz1w$.dlg@40tude.net> <1175488143.324741.283480@y80g2000hsf.googlegroups.com> Subject: Re: why learn C? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original Message-ID: NNTP-Posting-Host: 70.134.100.216 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr23.news.prodigy.net 1175492656 ST000 70.134.100.216 (Mon, 02 Apr 2007 01:44:16 EDT) NNTP-Posting-Date: Mon, 02 Apr 2007 01:44:16 EDT Organization: AT&T http://yahoo.sbc.com X-UserInfo1: Q[RGW^WETZSMB_DX]BCBNWX@RJ_XPDLMN@GZ_GYO^BSZUSAANVUEAE[YETZPIWWI[FCIZA^NBFXZ_D[BFNTCNVPDTNTKHWXKB@X^B_OCJLPZ@ET_O[G\XSG@E\G[ZKVLBL^CJINM@I_KVIOR\T_M_AW_M[_BWU_HFA_]@A_A^SGFAUDE_DFTMQPFWVW[QPJN Date: Sun, 1 Apr 2007 22:45:03 -0800 Xref: g2news1.google.com comp.lang.ada:14716 Date: 2007-04-01T22:45:03-08:00 List-Id: "kevin cline" wrote in message news:1175488143.324741.283480@y80g2000hsf.googlegroups.com... > On Mar 30, 4:09 am, "Dmitry A. Kazakov" > wrote: >> On Fri, 30 Mar 2007 07:44:31 +0000 (UTC), Lutz Donnerhacke wrote: >> > * kevin cline wrote: >> >> "The big difference is that C++ templates allow type checking during >> >> compile-time, so that no overhead neither in memory space nor in >> >> runtime is incurred. In this respect, C++ templates ARE MORE POWERFUL >> >> than Ada generics." >> >> > This is correct. C++-Templates itself are a Lisp dialect and Turing >> > complete. >> >> One should be careful with such statements. In fact it is apples and >> oranges, because whatever power templates might have, they are *not* >> executed on the target machine. > > So what? The discussion was about compile-time type safety, and the > point is that C++ templates, being Turing complete, allow more > thorough compile type checking than is possible in Ada. > Quite simply not true. I wonder whether you really understand Ada. The principle design goal of Ada is for a language that supports the maximum amount of error checking as early in the development process as possible. With a very small number of exceptions, Ada does this better than most existing languages and certainly better than C++. As to C++ templates, the Grein paper is rather narrowly focused and in ordinary cases, Ada templates are as type-safe as those in C++, and in all but a few cases more so. Further, C++ templates support an excessively complicated model that is easily turned into a mismash of errors that are not so easily detected until one is well along into the debugging process. Ada's visibility rules, which I suspect you do not understand very well due to your assertions about the language, are a powerful capability for ensuring a substantial amount of error-checking at compile time. C++ does not have this feature. Ada's library model, where the specification and the implementation are separately compiled, but also checked bit by bit by the compiler is also missing from C++. C++ data types are rather thin compared to those in Ada, and the ability of an Ada designer to design new types with constrained values is also missing from C++, unless one chooses to jump through hoops. There are so many benefits of Ada over C++ that anyone who wants to make an objective comparison can only conclude that Ada is, in most respects (not all respects), a far better language for developing dependable software. C++, on the other hand, is inherently error-prone. There are so many gotchas in the syntax and semantics that C++ developers are forced to depend on long hours of debugging -- far more of this than the equivalent Ada developer. If you do not know Ada, you can be forgiven for not realizing any of this. However, it might be useful for you to become acquainted with it so you will have a better understanding of what you criticize. I have programmed in Ada and C++. From my own experience, C++ is not a language I would ever want to use for anything that had to work predictably after being deployed. It is just too full of surprises. Richard Riehle