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!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!newscon04.news.prodigy.net!prodigy.net!newsdst01.news.prodigy.net!prodigy.com!postmaster.news.prodigy.com!newssvr21.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> Subject: Re: why learn C? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Message-ID: <6XbPh.4025$u03.802@newssvr21.news.prodigy.net> NNTP-Posting-Host: 70.134.100.216 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr21.news.prodigy.net 1175276354 ST000 70.134.100.216 (Fri, 30 Mar 2007 13:39:14 EDT) NNTP-Posting-Date: Fri, 30 Mar 2007 13:39:14 EDT Organization: SBC http://yahoo.sbc.com X-UserInfo1: FKPO@MC@@S@QBTLYYZH@^SXBUSXB@DTMNHWB_EYLJZ]BGIELK^RAQFW[ML\THRCKV^GGZKJMGV^^_JSCFFUA_QXFGVSCYRPILH]TRVKC^LSN@DX_HCAFX__@J\DAJBVMY\ZWZCZLPA^MVH_P@\\EOMW\YSXHG__IJQY_@M[A[[AXQ_XDSTAR]\PG]NVAQUVM Date: Fri, 30 Mar 2007 17:39:14 GMT Xref: g2news1.google.com comp.lang.ada:14684 Date: 2007-03-30T17:39:14+00:00 List-Id: "kevin cline" wrote in message news:1175230700.925143.28490@n59g2000hsh.googlegroups.com... > > Ada gives you low-level type safety out of the box, but does not > afford the tools necessary to achieve type-safety in high-level > programming. Low-level C++ coding is not type safe, but C++ provides > powerful mechanisms to write high-level type-safe code. > On reading the Grein paper, it is clear that the advantage is a very small, and very narrowly focused one. Any suggestion that C++ is, as a general principle, safer than Ada is simply a fantasy. Overall, compile-time safety in Ada is substantially superior to that in C++. C and C++ are highly error-prone. Programmers who choose C++ take for granted that long hours of debugging obscure errors is the way life ought to be. As for high-level programming, this is where Ada does excel. For large-scale, multi-developer projects C++ simply is a mess. There is no dependable model for separate programming. Oh yes, those CPP files! Well, they are inherently part of their own specification and they need to be augmented by compiler directives just to make sure there are not errors. I nearly guffawed when reading your last sentence. C++ as type safe? What a joke. Sadly, I suspect you actually believe this. With all mechanisms available in Ada for developing solid, dependable code and a language definition that focuses on creating compilers that maximize the amount of error detection that can be done early in the development process, I wonder whether you really understand Ada at all. Have you any understanding of the visbility rules? This goes well beyond type-safety. Do you understand the library model and how it affects separate compilation? As for the safety of generics, Grein's paper, which you take delight in citing, does not discount the fact that most generic constructs are type-safe at compile time. Further, getting it right, with C++ templates is no trivial feat either. There are plenty of opportunities to create errors in C++ templates. I have programmed in both languages. I have taught C++ and I have taught Ada. I have colleagues who use both languages who realize that C++ is far more error-prone than Ada. While one can get a good set of working software in C++ using heroic efforts, the chance of errors in a C++ program is much higher in a corresponding program written in Ada. I find it strange that anyone who understands both languages well would come to any other conclusion. Richard Riehle