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,d3432b5ee2e7ebcf X-Google-Attributes: gid103376,public From: miano@worldnet.att.net (John M. Miano) Subject: Re: ****************** Ada vs C++ Help ******************** Date: 1996/08/31 Message-ID: <508a18$1af@mtinsc01-mgt.ops.worldnet.att.net>#1/1 X-Deja-AN: 177582879 references: <3226aa7e.7480949@news.redstone.army.mil> organization: John Miano Software newsgroups: comp.lang.ada Date: 1996-08-31T00:00:00+00:00 List-Id: In article <3226aa7e.7480949@news.redstone.army.mil>, Sarner-BA-MD@PATRIOT-ccmail.SED.Redstone.Army.Mil wrote: >Does anyone know of some good papers comparing Ada 95 to C++. Would >especially be interested in any studies involving the comparison of >executables of similiar code modules in Ada95 and C++, ie size of .exe >and execution speed and how the code itself was fairly constructed to >be considered comparable to each other. I am on a project that is >being developed in C with tentative plans to go to Ada. It is a >government project that may fall under the "Ada mandate". However, >many of the contractors seem to have a definite *dislike* for Ada. At >650KSLOC, any Ada conversion will surely cost $$. They would rather >transition to C++. Probably because they could then recompile it and >call it that but also since C++ does support OO (the official party >line). 1. Code size and execution speed are a function of the compiler and not the language. 2. In almost any technical comparison from the theoretical point of view Ada is going beat C++. C++ is simply a compromise. C++ wins in most of the pragmatic areas: tools and available programmers. >Also, I have seen posts here saying C and C++ depend on pointer >arithmetic. Could someone please elaborate on this and why it is >considered to be "dangerous" or otherwise bad? I could sure use some >Ada ammo! This is not the case. The languages do not depend upon it but many programmers do. They are allow to because if the [] operator is not redefined then *(POINTER + X) is equivalent to POINTER [X]. For that matter in C A[X} and X[A} are equivalent. If you are really careful you can write programs that are just as clear and correct in C++ as you can in Ada. The problem is that C++ allows one to do the stupidest things imaginable and stupid things are encouraged. I have seen books and articles on C programming that claim for (ii = 0 ; ii < 10 ; ++ ii) * a ++ = * b ++ ; is preferable to for (ii = 0 ; ii < 10 ; ++ ii) A [ii] = B [II] ; because it is "more efficient". John World-Wide-Web: The CB Radio of the 90's