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: 109fba,1042f393323e22da X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,1042f393323e22da X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,1042f393323e22da X-Google-Attributes: gid1014db,public From: dweller@news.imagin.net (David Weller) Subject: Re: Any research putting c above ada? Date: 1997/04/12 Message-ID: <5inop1$g57@prime.imagin.net>#1/1 X-Deja-AN: 234296703 References: <5ih6i9$oct$1@waldorf.csc.calpoly.edu> <334d3da5.14386594@aplcen.apl.jhu.edu> <2senchydgk.fsf@hpodid2.eurocontrol.fr> <3359e813.340466234@news.pacificnet.net> Organization: ImagiNet Communications Ltd, Arlington, Texas Newsgroups: comp.lang.c++,comp.lang.c,comp.lang.ada Date: 1997-04-12T00:00:00+00:00 List-Id: In article <3359e813.340466234@news.pacificnet.net>, Kevin D. Quitt wrote: >ways. I've done it FORTRAN, C, C++, and assembler (not necessarily >combined). It's not the language or the compiler that makes it safe, it's >the programmer. > Kevin, Nobody has any doubt that you've written safe, effective software in FORTRAN, C, or C++, or even assembler. I think your implication that Ada developers lean entirely on the compiler is specious. A careful comparison of C++ to Ada 95 would yield these observations: 1) There is more compiler-generated checking in Ada 95 than in C++. These checks are typically things that are commonly overlooked in software development, particularly in large systems. These compile-time checks have no effect on the efficiency of the generated code. 2) Ada95 has _significantly_ more run-time checking than C++ has. Any run-time check obviously has an impact on efficiency, but when you field a system in Ada, you simply turn those run-time checks off (if you so desire). 3) Because of the increased amount of compile-time checking (as well as a few other factors), Ada95 compilers are much more capable of generating efficient code compared to C++. Before you (or anybody else) challenges such assertions, I will add that there has yet to be (to my knowledge) such a comparison made, but it can be discerned by analysis of the two languages. 4) You will generally write no more, if not less, code in Ada95 than you would to accomplish the same task in C++. (This is heresy to many, but the simple truth. It was also certainly the opposite, in some cases by an order of magnitude, when comparing Ada_83_ to C++). My general observations is that your Ada95 code can be up to around 10% smaller than equivalent C++ code, give or take 10%. I don't think having code 10% smaller really _proves_ much, but it dispels the perception Bjarne Stroustrup prepetuated in his book, "The Design and Evolution of C++" (an excellent book, by the way, should be part of any computer scientists library), where he indicated the Booch Components in Ada83 took 125K lines of code, and the C++ version took ~12K of code. The Ada 95 version of the Booch Components will take ~10K, and that's from a faithfully direct translation of the C++ version. Those numbers I have on very good authority, since the author of the Ada95 components is a close personal friend of mine :-) 5) Speaking of tasking...nah, never mind, that's a separate subject. Carefully note that NONE of my points above are saying: Individually, if you use language X, you'll be a better programmer than in language Y. It is quite possible to do "unsafe" things in Ada95 and to circumvent the _support_ that the compiler and run-time environment give you, but those "circumventions" practically stand up and scream at others that see the code. I've learned, over years of programming in both Ada95 and C++, that I find MUCH more errors in my code during execution with my C++ code than I do my Ada code. I'm not a shoddy programmer in either. It doesn't really take a rocket scientist to understand that it's easier to find and fix problems that the compiler catches than it is to become an expert on reading stack traces from core dumps. Nuf sed. I'm sure I'll start a flame war now with the crossposting going on. -- Booch Components Homepage: www.rivatech.com ||Ada Homepage: www.adahome.com ------NOTICE-----NOTICE-----NOTICE-----NOTICE-----NOTICE-----NOTICE-------- My new e-mail address is dweller@imagin.net. The dweller@dfw.net address will terminate _totally_ (no forwarding) at the end of April