comp.lang.ada
 help / color / mirror / Atom feed
* Re: Ada and C++: A request for comparison/contrast/relative benifits
@ 1993-08-09  5:25 Robert Dewar
  0 siblings, 0 replies; 11+ messages in thread
From: Robert Dewar @ 1993-08-09  5:25 UTC (permalink / raw)


Harry is too facile in awarding C++ the prize for greater functionality.
There are those who think that exceptions, control over bit placement in
records, built in tasking, etc. etc. might be quite useful [perhaps even
more useful than OOP features, who knows?]

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Ada and C++: A request for comparison/contrast/relative benifits
@ 1993-08-13  8:56 H.K. Pang
  0 siblings, 0 replies; 11+ messages in thread
From: H.K. Pang @ 1993-08-13  8:56 UTC (permalink / raw)


Cc: 

In article <246hpd$1r3@schonberg.cs.nyu.edu> dewar@cs.nyu.edu (Robert Dewar) wr
ites:
>Regarding the note on the difference in the Booch components between the
>Ada and C++ versions.
>
>First, part of the imnprovement simply comes from the recoding.
>
>Second, as Ed Schonberg has described in more details, the work we did
>as the IAT here at NYU showed that the C++ versions could be recoded in
>Ada 9X in a straightforward manner leading to a version that was about the
>same length, but, in our opinion was much more readable [we are not great
>fans of the C++ syntax -- probably one of the languages poorer features]
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
i must agree!

dear language designers, did you realize that most of the world's codes
were written by idiots? when you go to sleep tonight, think about what most
avearge programmers are like and what's their average IQ.










-- 
KO|+   pang@titan.ucs.umass.edu       I left my heart in Pittsburgh...
```                                          PH.D. xor $$$$$$$$$$

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Ada and C++: A request for comparison/contrast/relative benifits
@ 1993-08-11  4:49 Robert Dewar
  0 siblings, 0 replies; 11+ messages in thread
From: Robert Dewar @ 1993-08-11  4:49 UTC (permalink / raw)


Of course. Had to be Ted Holden! Quite revealing his choice of selections
from the revision requests (so quaintly retitled as complaints) don't you
think. I particularly enjoyed the idea that the failure of the grammar in
the description to be LR(m,n) constitutes a serious defect.

Thanks Ted for a good laugh and an interesting insight into your technical
tastes!

P.S. the 780-odd RR's do make interesting reading. There is a lot of
incredible junk, I won't quote some of my favorites for fear of
embarassing those who submitted them, but there is also a lot of good
stuff -- good suggestions and good examples. This input proved extremely
useful in the design of 9X, and is well worth going back to to understand
the 9X process.

P.P.S. I guess Ted must have got up one day and been hit on the head by
a mandate carelessly dropped out of someone's high level office. One can
only sympathize ...


^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Ada and C++: A request for comparison/contrast/relative benifits
@ 1993-08-10  2:43 cis.ohio-state.edu!math.ohio-state.edu!darwin.sura.net!seas.gwu.edu!mfeld
  0 siblings, 0 replies; 11+ messages in thread
From: cis.ohio-state.edu!math.ohio-state.edu!darwin.sura.net!seas.gwu.edu!mfeld @ 1993-08-10  2:43 UTC (permalink / raw)


In article <246hpd$1r3@schonberg.cs.nyu.edu> dewar@cs.nyu.edu (Robert Dewar) wr
ites:
>Regarding the note on the difference in the Booch components between the
>Ada and C++ versions.
>
>First, part of the imnprovement simply comes from the recoding.
>
>Second, as Ed Schonberg has described in more details, the work we did
>as the IAT here at NYU showed that the C++ versions could be recoded in
>Ada 9X in a straightforward manner leading to a version that was about the
>same length, but, in our opinion was much more readable [we are not great
>fans of the C++ syntax -- probably one of the languages poorer features]
>
Has this project been published? Will it be? Maybe a few examples at
least?

Also, when this was first discussed on the net (at least a year ago),
some people opined that a lot of the contraction came just from doing
it a second time with benefit of hindsight (the old Brooks principle).
Do you think that simple hindsight played a role?

Mike Feldman

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Ada and C++: A request for comparison/contrast/relative benifits
@ 1993-08-09 22:06 Robert Dewar
  0 siblings, 0 replies; 11+ messages in thread
From: Robert Dewar @ 1993-08-09 22:06 UTC (permalink / raw)


Regarding the note on the difference in the Booch components between the
Ada and C++ versions.

First, part of the imnprovement simply comes from the recoding.

Second, as Ed Schonberg has described in more details, the work we did
as the IAT here at NYU showed that the C++ versions could be recoded in
Ada 9X in a straightforward manner leading to a version that was about the
same length, but, in our opinion was much more readable [we are not great
fans of the C++ syntax -- probably one of the languages poorer features]

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Ada and C++: A request for comparison/contrast/relative benifits
@ 1993-08-09 18:53 Peter Juhl
  0 siblings, 0 replies; 11+ messages in thread
From: Peter Juhl @ 1993-08-09 18:53 UTC (permalink / raw)


A couple of references :

C++ Report June 1993, vol 5 / no 5 : paper by Grady Booch and Mike Vilot
explaining why the Booch Components are 150,000 lines in Ada and 10,000
lines in C++ (with added functionality and no loss of time or
space performance)

OOPSLA '92 Preliminary Defect Data from the Iterative Development of a
Large C++ Program: paper by James F. Walsh from Rational talking about
defect rates in a large C++ program. In the talk he mentioned that the
defect rates were similar to those found in large Ada programs.

--- peter (peju@research.att.com)

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Ada and C++: A request for comparison/contrast/relative benifits
@ 1993-08-09 13:45 agate!spool.mu.edu!darwin.sura.net!source.asset.com!theeke
  0 siblings, 0 replies; 11+ messages in thread
From: agate!spool.mu.edu!darwin.sura.net!source.asset.com!theeke @ 1993-08-09 13:45 UTC (permalink / raw)


In article <1993Aug6.203641.12218@newshost.lanl.gov> hines@paloverde.lanl.gov w
rites:
>
>Hello folks,
>
>N O   L A N G U A G E   W A R S ,   P L E A S E ! ! !
>
>Really, I'm serious. This is a simple request for information. I am personally
>an Ada fan, if you must know, but have been asked by a superior to provide som
e
>information.
								   
I'll post this, since I need help resolving the exact reference. 

In a previous life I remembered seeing a book-sized report that might help.
I made a call and got some more info, but can't tell you where to get a copy 
or if an update exists. All the info I have follows:

	Ada & C++: Business Case Analysis
	July 1991
	Produced by: Deputy Assistant of the USAF: Communications, Computers, a
nd 
		Logistics

I can tell you that the conclusion was that their is no reason why C++ should
be used over Ada. NO FLAMES PLEASE, I am just the messenger. Read the report
and draw your own conclusions! My opinion on the results I keep to myself for
religious reasons...

Good luck, hope this helps.

--
       |
     _/|__  _    Patrick A. Theeke                     theeke@source.ASSET.com
   _/   * |/_\   Senior Software Engineer
  /       _/     SAIC/Asset Source for Software Engineering Technology (ASSET)
 (       /       2611 Cranberry Square                 VOICE:  (304) 594-1762
  \____/         Morgantown, WV  26505                 FAX:    (304) 594-3951

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Ada and C++: A request for comparison/contrast/relative benifits
@ 1993-08-08 21:55 agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!math.ohio-state.edu!d
  0 siblings, 0 replies; 11+ messages in thread
From: agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!math.ohio-state.edu!d @ 1993-08-08 21:55 UTC (permalink / raw)


In article <26240@alice.att.com> bs@alice.att.com (Bjarne Stroustrup) writes:
>
>
>
>mfeldman@seas.gwu.edu (Michael Feldman @ George Washington University) write
>
> > Let's keep going with facts; flames to /dev/null.
>
>To achieve this lofty goal I think Ada proponents have to avoid a few things
>that occur frequently in comp.lang.ada - even in postings from the more sober
>members. The most obvious is:
>
>	Don't demonstrate an advantage of Ada over C and from that conclude
>	that Ada is therefore superior to C++.

I quite agree. I hope, Bjarne, that you did not think either Harry's post
or mine was confusing C with C++. In any case, I'm not fond of comparisons
that conclude global superiority or inferiority. Some macho types argue
that the mere length or diameter of a certain body part makes one guy
"superior" to the other. This is obviously only one dimension of their
existence. I think these "mine is BIGGER and BETTER than yours" religious
wars waste a huge amount of time and lead to no useful conclusions.

Better to assess things according to a number of dimensions, then let
people make an optimal decision for their own needs. Choosing a language
is an optimization problem. No perfect solution exists; perfection is
not a human trait, and we ought to stop pretending about this.

Therefore, there can be only _optimal_ solutions (i.e. the best of an
imperfect bunch of choices), and even these depend on what your 
optmization constraints are.

One of Harry's dimensions was expressive power. He drew a line like

C   Ada                                   C++
|----|-------------------------------------|

and I argued that generic templates, exceptions, and parallelism _in the
language_ compensate reasonably well for lack of inheritance, so that
the line could better be drawn

C                                     Ada C++
|--------------------------------------|---|

and that Ada9X may push Ada beyond C++. Whether it does or not is really
a matter of opinion, depending on how important one think MI really is.
Rosen argues, in an admittedly Ada-biased paper, that for many projects,
composition is a quite viable OO implementation, instead of hierarchy,
especially for long-life-cycle projects such as many for which Ada is 
intended. I'm purposely avoiding the loaded terms OOP and OOL, which carry
too much baggage. Looking at the merits of different design approaches,
one certainly finds Rosen's worth thinking about. (CACM 11/92)

In the comparison panel at ASEET 93, Jerry Sussman  - recruited as the
C++ spokesperson - drew essentially my line above, and argued that Ada
(especially Ada9X) and C++ have more in common than they have difference.
The Ada vs. C++ battles ar really at the margin, in his opinion and mine.
I happen to prefer Ada, mostly on grounds of personal preference of the
syntactic line. I like it better as a first language, because C++,
unfortunately, contains C within it and therefore all the seeds of
beginners' problems with the inner C syntax/semantics. But I claim no
monopoly on truth and wish others would be a bit more humble too.
>
Mike Feldman

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Ada and C++: A request for comparison/contrast/relative benifits
@ 1993-08-08 17:47 Bjarne Stroustrup
  0 siblings, 0 replies; 11+ messages in thread
From: Bjarne Stroustrup @ 1993-08-08 17:47 UTC (permalink / raw)


mfeldman@seas.gwu.edu (Michael Feldman @ George Washington University) write

 > Let's keep going with facts; flames to /dev/null.

To achieve this lofty goal I think Ada proponents have to avoid a few things
that occur frequently in comp.lang.ada - even in postings from the more sober
members. The most obvious is:

	Don't demonstrate an advantage of Ada over C and from that conclude
	that Ada is therefore superior to C++.

This is an invitation to a counterflame because C++ programmers will interprete
it as either plain ignorance (commonly the real reason) or manipulation by
presentation of selective facts.

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Ada and C++: A request for comparison/contrast/relative benifits
@ 1993-08-08  0:46 Michael Feldman
  0 siblings, 0 replies; 11+ messages in thread
From: Michael Feldman @ 1993-08-08  0:46 UTC (permalink / raw)


In article <241b49$b44@truffula.fp.trw.com> erwin@trwacs.fp.trw.com (Harry Erwi
n) writes:
>The query is for a comparison/contrast/relative benefits assessment of C++
>and Ada. I'll introduce C as a third comparison point.
I'm going to try to keep this as factual as I know how; our experiences
are all different and your mileage may vary.
>
>1. Development cost: If C development costs "1" and assembly language
>costs "3", the costs for both C++ and Ada (in my experience) run between 1
>and 3. The reason C++ costs so much is that I'm a simulation programmer,
>and I find myself getting into the arcane details of allocators,
>iterators, etc. Ada costs more than C because it takes more work to write
>the same code (about 2x). Of course, the maintenance costs of Ada are much
>less...
No problem here. Also the testing costs should be lower (see below):
>
>2. Performance. A C SLOC converts into about 5 machine language
>instructions. C++ is about the same...except for allocators, copy
>operators, destruction operators, etc., which tend to be invisible to the
>programmer, but not to the performance engineer. Ada SLOCs convert to
>about 10 machine language instructions (2xC), but you don't get into the
>arcane object creation/copying/destrution stuff. Experience suggests C++
>code can be very crufty if the programmer doesn't keep this arcane lore in
>mind.
I can't speak for C++, but many quite reasonable benchmarks have shown
that, for reasonably comparable algorithms and optimizations, the time
and space performance of Ada programs is very near to, sometimes better
than, C. I think the 2xC figure is not unreasonable, but represents
a specific compiler/algorithm pair. And a lot of the extra Ada instructions
often come from run-time checking code not present in the C code.

Those checks can, of course, be suppressed if the programmer wishes,
and this will make the algorithms exactly comparable; the resulting
code should then be comparable in size and speed. Why would it not be?

Also, using Ada _well_ can result in better-optimized code.
As an example, consider making a copy of a 2-d array. In C you would
write this in a nested loop. (See below for comments on tricks.)
In Ada, you'd simply write 

A := B;

and let the compiler use block moves to carry out the copying. Any
reasonable Ada optimizer should (I'm not saying _does_) do this.
If A and B are of known size, the compiler can generate a few big moves
to copy the data, and skip all the loop overhead.

In C, you could use some sort of trickery - as
is sometimes done with assembler, or EQUIVALENCEs in Fortran - to cut
down on the number of iterations, thus on the loop overhead. But in Ada,
the structures are such that - if one uses them intelligently -
the compiler can optimize what you were hand-optimizing in other
languages. I think people underestimate the power of predefined
assignment (and equality test) for optimization. Or maybe the compilers
aren't handling it well, but that's for another discussion.
>
>3. Functionality/Power. C and Ada are similar. C++ introduces
>object-oriented programming, complete with run-time resolution of
>linkages. The only kitchen sink missing from C++ is call by name (in
>Simula and Smalltalk, you can make a function call and have the parameters
>copied in at evaluation time (repetitively if necessary)).  This reduces
>the power of the language, but not a lot.
Things like the universal copying, coupled with much stronger compile-
time checking and run-time checking/exception propagation, give Ada expressive 
power closer to that of C++ than to that of C. In C++ you are gaining OOP 
at the cost of genericity, exceptions, and parallelism; in Ada it's the 
other way around. For many applications this is an equivalent trade, in most 
of the analyses I've seen. 

C++ is adding generic templates and exceptions; Ada is adding single
inheritance and dynamic dispatching. This leaves Ada9X missing
multiple inheritance, which is controversial at best, with some C++
fans saying it's a solution in search of a problem. C++ is left without
parallelism, at least as far as I know. This makes them pretty equivalent,
both in their current and their evolving forms.
>
>I guess in conclusion, Ada costs more and is easier to maintain. C++ has
>more power, but is harder to code and maintain, and has arcane features. C
>costs less, has less features, costs more to maintain, but is easier to
>use in real-time applications.
Your last statement is quite hard to follow. Ada's real strength is in
real-time applications, as evidenced by the fact that
- ALL new jetliners are using Ada in their avionics;
- ALL new air-traffic-control systems (as far as I know) are being done
  in Ada, from US and Canada to Vietnam, with Europe and Africa in between;
- a good deal of the European high-speed rail system is being done in Ada,
  especially R/T stuff like train control/communication.

Undoubtedly C is easier for small-scale PC-based realtime systems or
simulators. But harder to test, debug, and maintain. I'll post a new
story about French Rail, which is moving over to Ada from a large
C-based system for train control. The main reason is Ada's much easier
testing and maintenance.

Let's keep going with facts; flames to /dev/null.

Mike Feldman

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Ada and C++: A request for comparison/contrast/relative benifits
@ 1993-08-07 22:42 cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!news.ecn
  0 siblings, 0 replies; 11+ messages in thread
From: cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!news.ecn @ 1993-08-07 22:42 UTC (permalink / raw)


The query is for a comparison/contrast/relative benefits assessment of C++
and Ada. I'll introduce C as a third comparison point.

1. Development cost: If C development costs "1" and assembly language
costs "3", the costs for both C++ and Ada (in my experience) run between 1
and 3. The reason C++ costs so much is that I'm a simulation programmer,
and I find myself getting into the arcane details of allocators,
iterators, etc. Ada costs more than C because it takes more work to write
the same code (about 2x). Of course, the maintenance costs of Ada are much
less...

2. Performance. A C SLOC converts into about 5 machine language
instructions. C++ is about the same...except for allocators, copy
operators, destruction operators, etc., which tend to be invisible to the
programmer, but not to the performance engineer. Ada SLOCs convert to
about 10 machine language instructions (2xC), but you don't get into the
arcane object creation/copying/destrution stuff. Experience suggests C++
code can be very crufty if the programmer doesn't keep this arcane lore in
mind.

3. Functionality/Power. C and Ada are similar. C++ introduces
object-oriented programming, complete with run-time resolution of
linkages. The only kitchen sink missing from C++ is call by name (in
Simula and Smalltalk, you can make a function call and have the parameters
copied in at evaluation time (repetitively if necessary)).  This reduces
the power of the language, but not a lot.

I guess in conclusion, Ada costs more and is easier to maintain. C++ has
more power, but is harder to code and maintain, and has arcane features. C
costs less, has less features, costs more to maintain, but is easier to
use in real-time applications.

Cheers,
-- 
Harry Erwin
Internet: erwin@trwacs.fp.trw.com
Working on Freeman nets....

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

end of thread, other threads:[~1993-08-13  8:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-08-09  5:25 Ada and C++: A request for comparison/contrast/relative benifits Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1993-08-13  8:56 H.K. Pang
1993-08-11  4:49 Robert Dewar
1993-08-10  2:43 cis.ohio-state.edu!math.ohio-state.edu!darwin.sura.net!seas.gwu.edu!mfeld
1993-08-09 22:06 Robert Dewar
1993-08-09 18:53 Peter Juhl
1993-08-09 13:45 agate!spool.mu.edu!darwin.sura.net!source.asset.com!theeke
1993-08-08 21:55 agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!math.ohio-state.edu!d
1993-08-08 17:47 Bjarne Stroustrup
1993-08-08  0:46 Michael Feldman
1993-08-07 22:42 cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!news.ecn

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