comp.lang.ada
 help / color / mirror / Atom feed
* KSLOC estimates Ada vs C++
@ 1999-05-27  0:00 Raymond Calande
  1999-05-28  0:00 ` Marin David Condic
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Raymond Calande @ 1999-05-27  0:00 UTC (permalink / raw)


Has anyone ever seen a reference in which a comparison is done that
shows the relative size in KSLOC for Ada versus C++ for the equivalent
program?
TIA





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: KSLOC estimates Ada vs C++
  1999-05-27  0:00 KSLOC estimates Ada vs C++ Raymond Calande
  1999-05-28  0:00 ` Marin David Condic
@ 1999-05-28  0:00 ` Richard D Riehle
  1999-06-13  0:00 ` Jack Florio
  2 siblings, 0 replies; 5+ messages in thread
From: Richard D Riehle @ 1999-05-28  0:00 UTC (permalink / raw)


In article <374DCB87.6EE9BE49@lmco.com>,
	Raymond Calande <ray.calande@lmco.com> wrote:

>Has anyone ever seen a reference in which a comparison is done that
>shows the relative size in KSLOC for Ada versus C++ for the equivalent
>program?
>TIA
>

One can easily understand why such a question would be asked.  We
are often looking for simple comparisons that can help us make
decisions about complicated matters.  

Unfortunately, such a comparison is likely to be at best inconclusive,
probably misleading, and at the very worst ridiculous.  In some cases, 
a C++ program might be a little larger.  In others, Ada might have more
KSLOC. What would be infer from such a comparison?

1) Ada/C++ is easier to write?

2) Ada/C++ is easier to maintain through the full lifecycle?

3) Ada/C++ is easier to read?

4) Ada/C++ improves productivity?

5) None of the above

The correct answer is, None of the above.  

There are so many hidden factors. Do we include the number of KSLOC 
of the libraries used in each program?   Does the size of the problem
contribute to the size of the program, and does an Ada program solution
become smaller as the problem gets larger?   Is a short C++ program 
shorter than a short Ada program?  

It would be convenient if we could reduce our decision-making to this kind
of information.  As is so often affirmed in contemparary sitcoms, "Size
doesn't matter."

Richard Riehle
richard@adaworks.com
http://www.adaworks.com




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: KSLOC estimates Ada vs C++
  1999-05-27  0:00 KSLOC estimates Ada vs C++ Raymond Calande
@ 1999-05-28  0:00 ` Marin David Condic
  1999-05-28  0:00 ` Richard D Riehle
  1999-06-13  0:00 ` Jack Florio
  2 siblings, 0 replies; 5+ messages in thread
From: Marin David Condic @ 1999-05-28  0:00 UTC (permalink / raw)


Raymond Calande wrote:
> 
> Has anyone ever seen a reference in which a comparison is done that
> shows the relative size in KSLOC for Ada versus C++ for the equivalent
> program?
> TIA

After having been involved with software metrics for the last ten years,
I'd advise that this is a hopelessly meaningless comparison. Even
attempting to compare two programs written in the same language, but
solving different problems is difficult and loaded with land mines.

Obviously, there are going to be problems which are more easily and
naturally expressed in Ada which will take fewer slocs than an
equivalent C++ program. The converse also being true. If you are looking
for a metric on efficiency or cost or almost anything else, I'd suggest
trying something else.

It never hurts to create some benchmarks of applications that are
"typical" for your problem domain and seeing how a quality
implementation in either language fares. But you have to be careful that
you aren't misleading yourself or testing the effects of one specific
implementation. Its a sticky problem. It would be nice if we were
comparing blivet-stamping machines where there is going to be a clear
winner based on volume, but we never build the same thing twice so it's
a lot more complicated problem.

MDC
-- 
Marin David Condic
Real Time & Embedded Systems, Propulsion Systems Analysis
United Technologies, Pratt & Whitney, Large Military Engines
M/S 731-95, P.O.B. 109600, West Palm Beach, FL, 33410-9600
***To reply, remove "bogon" from the domain name.***

Visit my web page at: http://www.flipag.net/mcondic




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: KSLOC estimates Ada vs C++
@ 1999-05-28  0:00 Robert I. Eachus
  0 siblings, 0 replies; 5+ messages in thread
From: Robert I. Eachus @ 1999-05-28  0:00 UTC (permalink / raw)



     I'll echo what has already been said, but make two additional
comments.
First, if you implement the same algorithm in both Ada and C++, the
usual result is that if you deal with the possible error conditions, the
Ada code is smaller, otherwise the C++ wins.  But we are talking a very
small (order of 10% either way) effect.

     Second, the major difference you are likely to see is where the
application specific libraries (packages or classes) are available in
one language and not the other, or the library is more suited to the
actual problem statement.  For example, when doing this type of
comparison, you often have to be willing to edit the requirements in the
area of terminal or screen IO.  Neither language is obviously better in
this area, but you have to be willing to accept the langauge defaults. 
Take a program that reads in floating point numbers.  Ada and C++ have
different rules for things like non-base ten values.  You would have to
do a lot of extra work to get C++ to accept 16#FFFF.FFFF#E-23, and some
extra work to get Ada to reject it.
-- 

                                        Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: KSLOC estimates Ada vs C++
  1999-05-27  0:00 KSLOC estimates Ada vs C++ Raymond Calande
  1999-05-28  0:00 ` Marin David Condic
  1999-05-28  0:00 ` Richard D Riehle
@ 1999-06-13  0:00 ` Jack Florio
  2 siblings, 0 replies; 5+ messages in thread
From: Jack Florio @ 1999-06-13  0:00 UTC (permalink / raw)
  To: ray.calande

The best comparison I'd suggest is looking at it from a Function Point
perspective.
Check http://www.spr.com/library/0langtbl.htm by Capers Jones.
Excerpt from the list on average number of statements to implement a
function point:
Ada 83:  71
Ada 95:  49
C++:      53

the rest of the math is left as an exercise for the student....    ;-)

Jack.Florio@lmco.com.nospam

Raymond Calande wrote:

> Has anyone ever seen a reference in which a comparison is done that
> shows the relative size in KSLOC for Ada versus C++ for the equivalent
> program?
> TIA





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1999-06-13  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-05-27  0:00 KSLOC estimates Ada vs C++ Raymond Calande
1999-05-28  0:00 ` Marin David Condic
1999-05-28  0:00 ` Richard D Riehle
1999-06-13  0:00 ` Jack Florio
  -- strict thread matches above, loose matches on Subject: below --
1999-05-28  0:00 Robert I. Eachus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox