From: miano@worldnet.att.net (John M. Miano)
Subject: Re: ****************** Ada vs C++ Help ********************
Date: 1996/08/31
Date: 1996-08-31T00:00:00+00:00 [thread overview]
Message-ID: <508a18$1af@mtinsc01-mgt.ops.worldnet.att.net> (raw)
In-Reply-To: 3226aa7e.7480949@news.redstone.army.mil
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
next prev parent reply other threads:[~1996-08-31 0:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-08-30 0:00 ****************** Ada vs C++ Help ******************** Sarner-BA-MD
1996-08-30 0:00 ` Adam Beneschan
1996-08-31 0:00 ` David C. Hoos, Sr.
1996-08-31 0:00 ` John M. Miano [this message]
1996-09-03 0:00 ` Robert A Duff
1996-09-02 0:00 ` John Herro
1996-09-03 0:00 ` Bob Kitzberger
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox