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,54c513170bafd693 X-Google-Attributes: gid103376,public From: Richard D Riehle Subject: Re: Desirability of C++ Date: 2000/05/02 Message-ID: <8elagm$200$1@slb3.atl.mindspring.net>#1/1 X-Deja-AN: 618080754 References: <01HW.B4BFC2820005B06B08A24140@news.pacbell.net> <20000204073443.24976.00001288@ng-ci1.aol.com> <87euk0$c93$1@nnrp1.deja.com> <01HW.B4C1346100072D2408A24140@news.pacbell.net> <949867976.281549@the-rowan.albatross.co.nz> <8766v93w66.fsf@deneb.cygnus.argh.org> <38E8C81A.AA62CF4C@HiWAAY.net> <7EA1B852F5D4D8C6.26EEE9181C80F0DF.0161EA2D9C353253@lp.airnews.net> <01HW.B51C1B6E00F41C2D04BB51B0@news.pacbell.net> <38F796B2.A99A206A@ftw.rsc.raytheon.com> <38F7A27A.4F7729FA@raytheon.com> <8eclae$afj$1@slb7.atl.mindspring.net> <4F706057FEE2A550.BF5FE19AE279EFCD.A55706B3F9D07043@lp.airnews.net> <8eiv08$820$1@slb1.atl.mindspring.net> <390D001C.7433140B@netwood.net> <390D58F9.7CC64B85@maths.unine.ch> Organization: MindSpring Enterprises X-Server-Date: 2 May 2000 01:20:22 GMT Newsgroups: comp.lang.ada Date: 2000-05-02T01:20:22+00:00 List-Id: In article , Hyman Rosen wrote: >What does that mean? C++ functions can return things other than integers >and pointers, and there is a simple way in C++ to make arrays with bounds >but no OO bloat. You are, of course, correct that C++, using the library classes can make array management much easier than the low-level arrays usually constructed by programmers. The same is true of smart pointer classes. I recently did a little informal survey of students where I teach and none of them had learned anything about this better aspect of C++. >While C++ syntax can sometimes be abysmal, I am 100% convinced that the >main reason for the lack of Ada's popularity is its Pascal-derived syntax. >Even after many attempts, I still can't look at a chunk of Ada code without >my eyes swimming from the mass of undifferentiated text. If the designers >had gone with {/} instead of is/begin/end, this could have been a different >world. (And yes, I know that the internationalists wouldn't hear of using >curly braces back then.) That Ada syntax is 1) intended to make the code more readable, 2) enable the compiler to ensure completeness of each statement, 3) ensure that the programmer does not forget any little details that could affect the final logic of the program. The abysmal C++ syntax (along with abysmal Java syntax) does permit incomplete statements, and does not give the compiler a fine-grained semantics that would enable the level of compile-time error checking we enjoy with Ada. As for curly-braces, we are already experience a worldwide shortage of this pair of punctuation marks. Worse, curly-braces are the crabgrass of computer programming. They require no labeling, and even when labeled the compiler does not check those labels. They are inconsistently used throughout the C family of languages. This is one of the things Java could have fixed and, for some odd reason chose to leave as is. The reasons for Ada's lack of popularity are far more complex than the absence of curly braces. It starts way back with the ineffectual management of the DoD and the agencies charged with making Ada policy work. It can, in part be laid at the feet of compiler publishers, some of whom saw the opportunity to charge outrageous prices for their product because the military had "mandated" the language and there was no choice for them but to pay those prices. It can be seen in the demand from the DoD to use the Ada language for projects for which there was no compiler technology available and the resulting resentment of those who had to find a way around the policy. It can be found in the checkbox compilers that no one expected to be any good but which satisfied the checkbox on the bidding form that asked if there were a validated Ada compiler. I could go on, but readers of this forum have heard this before. The point is, the lack of curly braces is not a significant issue in the low popularity of Ada. I have had the opportunity over the past few years to get better acquainted with C++. The more I study C++, the deeper my realization that it is a dangerous choice for any software in which human safety is involved. Ada still has significant advantages over C++ in that domain. My earlier statements about C++ versus Ada stand. Any technologically savvy decision-maker who chooses C++ over Ada for a safety-oriented software product is making that decision for reasons other than the relative technical benefits of the language. Richard Riehle richard@adaworks.com