comp.lang.ada
 help / color / mirror / Atom feed
From: whraven@msn.fullfeed.com (Richard Pinkall-Pollei)
Subject: Re: Help me to chose between ADA 95 and C++
Date: 1999/12/15
Date: 1999-12-15T00:00:00+00:00	[thread overview]
Message-ID: <slrn85foo2.cqi.whraven@raven.wri> (raw)
In-Reply-To: Pine.BSF.4.21.9912131540530.6417-100000@shell5.ba.best.com

With some trepidation, I'm throwing my "int cents = 2;"/"cents:
integer range 0..99 := 2;" worth in.  I use both languages at work and
at home.  I don't care to argue specific language features, since such
preferences are very much tied to personal taste and familiarity; both
languages are general-purpose so that essentially any programming task
can be written in either language with some differences in effort
required.  When comparing Ada to C++, I look at the overall language
design in relation to three general categories:  programming effort
(cost), portability, and transition from design specification to
actual code.

As far as programming effort goes, Ada programs are much easier to
write in general.  The Ada philosophy of strict typing along with
various other consistency checks relieve the programmer of doing these
tedious checks himself; if the program compiles correctly, an Ada
program is much more likely to execute correctly than a C++ program
unless the programmer has been *very* careful.  Likewise, C++ is more
of a "build it yourself" language -- some of the standard Ada language
features such as multi-threading (POSIX threads), protected types
(mutex's), and exceptions (an exception type must be defined before it
can be used) must be hand-coded when using C++ (of course, this is an
advantage for those who like to build their own -- it can be done in
Ada, but it's easier in C++).  As well, whenever a scalar type of a
certain accuracy is required, a C++ programmer must know the machine
representation of the built-in types before deciding which type to
use, as opposed to direct specification of accuracy in Ada.  Finally,
repeated studies have confirmed that it costs less to write and
maintain non-trivial Ada programs.

C++ compilers run on more machine architectures and operating systems
than Ada compilers, but C++ requires a little more effort to create
truly portable programs.  Various tools have been developed, such as
automake and it's relatives, that compensate for differing header file
and library implementations among various systems.  Ada source code,
on the other hand, will run unchanged on multiple architectures
(unless one uses the C language hooks or non-standard, implementation
specific features that *must* be documented).  Part of the reason I'm
jumping in is that I'm facing a portability dilemma involving C++ and
Ada.  I recently acquired an Alpha-based machine running Linux.  There
are not pre-built GNAT binaries for this particular CPU/OS
combination, and since GNAT is written in Ada, I am trying to build a
cross compiler that will allow me to port GNAT to that machine.  That
way, the programs I write in GNAT will be easily portable to that
system.  The problem is that GNAT is based on the old GCC 2.8.1
release, and I'm having some porting problems, so I have to decide
whether the time spent porting GNAT is more important than converting
to C++ for these particular programs.

Finally, for me, program specification and design precede coding for
any non-trivial program I write.  While I can think in both C++ and
Ada, I find that when I write specifications and design interfaces,
the text resembles Ada -- so much so that I can use the specs almost
directly as Ada code.

As a last comment, there are a lot more C++ programmers than Ada
programmers.  This strikes me as another example of the "nobody ever
got fired for using <whatever>" syndrome.  IBM was one of the first
examples.  Our shop uses Unisys hardware for our largest and most
critical applications because it's better designed and more powerful
than equivalent IBM hardware.  Yet, IBM is still the best-selling
hardware.  The same is true of Micro$oft -- it's not the best OS by a
long shot, but people tend to stick with what their comfortable with.
Ada now seems in the same boat -- for my money, it is generally the
best programming language available for most purposes.  Yet, as things
stand, it will not overcome C++'s popularity in the foreseeable
future.  So, I'll just keep pluggin' away at promoting it, and hope
someday it will become the next Linux phenomenon.


Rich Pinkall-Pollei
Team Ada
Ada for Linux Team
---
A computer lets you make more mistakes faster than any other invention,
with the possible exceptions of handguns and Tequilla.
	-- Mitch Ratcliffe




  parent reply	other threads:[~1999-12-15  0:00 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-26  0:00 Help me to chose between ADA 95 and C++ Robert
1999-11-26  0:00 ` Preben Randhol
1999-11-26  0:00   ` Preben Randhol
1999-11-26  0:00 ` Harald Schmidt
1999-11-26  0:00   ` Andreas Winckler
1999-11-26  0:00     ` Florian Weimer
1999-12-04  0:00   ` Richard D Riehle
     [not found]     ` <01bf3e32$0b9dc880$022a6282@dieppe>
1999-12-10  0:00       ` Chris Powell
1999-12-13  0:00         ` Marin D. Condic
1999-12-13  0:00         ` Richard D Riehle
1999-12-14  0:00           ` Chris Powell
1999-12-14  0:00             ` Simon Wright
1999-12-15  0:00               ` Chris Powell
1999-12-15  0:00                 ` Robert A Duff
1999-12-14  0:00             ` Richard D Riehle
1999-12-14  0:00               ` Matthew Heaney
1999-12-14  0:00             ` Ray Blaak
1999-12-14  0:00             ` Larry Kilgallen
1999-12-15  0:00               ` Robert A Duff
2000-01-12  0:00                 ` Richard Pinkall-Pollei
1999-12-15  0:00             ` Ted Dennison
1999-12-20  0:00               ` Stefan Skoglund
1999-12-16  0:00             ` Pascal Obry
1999-12-16  0:00               ` Rakesh Malhotra
1999-12-21  0:00                 ` Geoff Bull
1999-12-16  0:00               ` Aidan Skinner
1999-12-16  0:00               ` Lutz Donnerhacke
1999-12-21  0:00             ` Robert Dewar
1999-12-21  0:00               ` Chris Powell
1999-12-21  0:00               ` Ted Dennison
1999-12-21  0:00                 ` Robert Dewar
1999-12-13  0:00         ` DuckE
1999-12-14  0:00           ` Matthew Heaney
1999-12-13  0:00         ` Brian Rogoff
1999-12-14  0:00           ` Chris Powell
1999-12-14  0:00             ` Preben Randhol
1999-12-14  0:00               ` Stephen Leake
1999-12-14  0:00                 ` Tucker Taft
1999-12-15  0:00                   ` Stephen Leake
1999-12-15  0:00                 ` Preben Randhol
1999-12-14  0:00             ` Brian Rogoff
1999-12-15  0:00           ` Richard Pinkall-Pollei [this message]
1999-12-15  0:00             ` Richard Pinkall-Pollei
1999-12-21  0:00             ` Geoff Bull
1999-12-21  0:00               ` Tucker Taft
1999-12-22  0:00                 ` Ted Dennison
1999-12-14  0:00         ` Matthew Heaney
1999-12-14  0:00           ` Chris Powell
1999-12-14  0:00             ` Stephen Leake
1999-12-23  0:00               ` Chris Powell
1999-12-14  0:00             ` Tucker Taft
1999-12-14  0:00               ` Matthew Heaney
1999-12-23  0:00               ` Chris Powell
1999-12-27  0:00                 ` Robert A Duff
1999-12-14  0:00             ` Matthew Heaney
1999-12-15  0:00               ` Hyman Rosen
1999-11-26  0:00 ` Andreas Winckler
1999-11-27  0:00 ` Lionel Draghi
  -- strict thread matches above, loose matches on Subject: below --
1999-12-14  0:00 Robert C. Leif, Ph.D.
1999-12-15  0:00 ` Richard D Riehle
1999-12-15  0:00 Robert C. Leif, Ph.D.
1999-12-16  0:00 ` Richard D Riehle
1999-12-16  0:00   ` Matthew Heaney
1999-12-17  0:00     ` Richard D Riehle
1999-12-18  0:00       ` Matthew Heaney
1999-12-20  0:00         ` Richard D Riehle
1999-12-22  0:00 Help me to chose between ADA 95 and C++ ( Ehud Lamm
replies disabled

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