comp.lang.ada
 help / color / mirror / Atom feed
From: Richard D Riehle <laoXhai@ix.netcom.com>
Subject: Re: Help me to chose between ADA 95 and C++
Date: 1999/12/13
Date: 1999-12-13T18:17:54+00:00	[thread overview]
Message-ID: <833d8i$sjf$1@nntp5.atl.mindspring.net> (raw)
In-Reply-To: 385112AE.7E2CFA9@rdel.co.uk

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 5812 bytes --]

In article <385112AE.7E2CFA9@rdel.co.uk>,
	Chris Powell <chris.powell@rrds.co.uk> wrote:

>Pascal Obry wrote:
>> 
>> Richard D Riehle <laoXhai@ix.netcom.com> a �crit dans l'article
>> <829rbv$a8m$1@nntp6.atl.mindspring.net>...
>> > Smalltalk is certainly a nicely designed language. However,
>> > if one is serious about object-oriented programming,
>> > Ada is an excellent choice. The only appropriate alternative
>> > to Ada, for serious OOP, is probably Eiffel.
>> 
>> I second that. For me the 2 bests designed languages for serious
>> (read industrial) OO development are Ada and Eiffel.
>> 
>> Pascal.
>> 
>
>I would not recommend Ada 95 for OO development. Okay, it has all the
>benefits of Ada 83 for type safety, etc, but the syntax of its class
>programming constructs seems to make the code long winded, obscure and
>error prone. I can give examples if anyone is interested/disagrees.

Since this is a response to something I said, I suppose I must say
something.  

1) Type safety    This is a real benefit of Ada that is not
                  as well represented in C++.  The default in
                  Ada, for every construct, is type safe. The
                  default, in the C family of languages, including
                  C++, is type unsafe.  It is true that one can
                  make C++ a little more type safe, but this requires
                  additional effort, an understanding of which
                  class to use (smart pointers, etc.) and a great
                  deal of careful programming.  Even with that care,
                  a C++ maintenance programmer has all the tools to 
                  easily violate the type safety another programmer has                                                    
                  diligently developed.

2) Long-winded    Speaking as a person reknowned for being a little
                  long-winded, at times, I do not find this to be a
                  bad thing.  Seriously,  Ada seems long-winded because
                  of the very rules that support the default for
                  type safety.  Among these rules one finds a very 
                  strict model for scope versus visibility, a language
                  feature that C++ has tried to adopt, but which falls
                  far short of that already integrated into the Ada
                  language.  I can teach someone unfamiliar with Ada
                  to read it more easily than I can teach the same skill
                  to someone unfamiliar with C/C++.

3) Obscure        Sure this falls into the category of what clinical
                  pyschologists call "projection."  One of my favorite
                  columns from the magazine, "C++ Report," is at the
                  end of each issue and titled, "Obfuscated C++."  One
                  create C++ code that is so mangled that even the most
                  expert of C++ practitioners is hard-pressed to explain
                  the exact outcome.  It is far easier to write obfuscated
                  C++ that obfuscated Ada.  

4) Error Prone    Here we go with the projection again.  The notion that
                  Ada is more error-prone than C++ reflects either an
                  ignorance of Ada, an ignorance of C++ or both. I can't
                  imagine anyone who knows both languages _well_
                  making such a statement.  

>I suppose C++ is a swear word in this newsgroup, but I prefer it, even
>though I preferred Ada 83 to C. C++ is more type safe than C, the
>Standard Template Library (if used) can protect from memory leaks, array
>bounds checking, etc; the sorts of problems that made C unsuitable for
>'industrial strength' development. (Ironically, C has been used for lots
>of very serious software, though).

No, C++ is not a swear word.  C++ is a language with much to recommend
it for certain circumstances.  However, anyone who would choose C++
over Ada for safety-critical software, especially DoD weapon systems,
is suffering from a failure to understand the relative virtues of
both languages.   One of my colleagues, who shall remain unnamed, says
that picking C++ over Ada is irresponsible.  While I might consider his
opinion a little over-stated, he is not without some knowledge of this
issue.  

As to the STL, you are kidding, of course.  The fundamental ideas of 
STL are important and many of those components are excellent.  I still
hear from colleagues here in Silicon Valley who grumble about their
reliability and the level of support offered by compiler publishers.
Add to that your parenthetical qualification, "(if used)," and you 
have another interesting problem.  Rarely do I seen anyone using
smart pointers or smart array classes as implemented in STL.  This is
sad since these are among the more important STL components available.
Even when they are used, it is often so sparingly that one continues
to find pointer problems scattered merrily through the rest of the code.

C++, when used correctly and responsibly, is an excellent language for
many kinds of software development.  It is not appropriate for safety
critical software, the application domain best served by Ada. It is
a stupid choice for business data processing software except where one
is interfacing to some kind of GUI environment, since it does not have
inherent support for financial data types (a la COBOL and Ada). It
it is not particularly well-suited to software that needs to be modified
a lot.  

Not that I have an opinion about this.  :-)

Richard Riehle

            P.S.  Example code fragments could be thrown back and
                  forth over the transom, but it would be an endless
                  dialogue of example and counter-example that would
                  lead nowhere.  
 




  parent reply	other threads:[~1999-12-13  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 ` Andreas Winckler
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         ` 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
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-13  0:00         ` Richard D Riehle [this message]
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             ` Larry Kilgallen
1999-12-15  0:00               ` Robert A Duff
2000-01-12  0:00                 ` Richard Pinkall-Pollei
1999-12-14  0:00             ` Ray Blaak
1999-12-14  0:00             ` Richard D Riehle
1999-12-14  0:00               ` Matthew Heaney
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               ` Aidan Skinner
1999-12-16  0:00               ` Lutz Donnerhacke
1999-12-16  0:00               ` Rakesh Malhotra
1999-12-21  0:00                 ` Geoff Bull
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         ` Marin D. Condic
1999-12-13  0:00         ` DuckE
1999-12-14  0:00           ` Matthew Heaney
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-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