comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Rogoff <bpr@shell5.ba.best.com>
Subject: Re: Help me to chose between ADA 95 and C++
Date: 1999/12/14
Date: 1999-12-14T00:00:00+00:00	[thread overview]
Message-ID: <Pine.BSF.4.21.9912141704270.13496-100000@shell5.ba.best.com> (raw)
In-Reply-To: 38564CD6.F13F69FB@rdel.co.uk

On Tue, 14 Dec 1999, Chris Powell wrote:
> Brian Rogoff wrote:
> 
> > Of course, none of this is really OO, but I think OO is way overrated anyways.
> > Since you mention STL in the same paragraph as OO, I suppose I should ask
> > you what you mean by OO. Most people wouldn't consider the STL OO,
> > including its authors.
> 
> Its true that the STL is not implemented using OO constructs, but it is
> conceptually OO, with the concept of a container base class defining
> methods for manipulating elements, which are overriden to work
> differently for specific container types and the abstraction of
> iterators which can work on any type of container... but this wasn't
> really why I mentioned the STL:

Conceptually, its just modular/ADT style programming with heavy use of 
parameterized types. The main idea is decoupling containers from the 
algorithms which work on them by providing intermediary structures for
traversing and accessing those containers (called "iterators") and writing 
all of the algorithms in terms of these iterators. The important
efficiency argument given by STL proponents is that there is no run time 
dispatching in the library at all; everything is known at compile time and 
so a sufficiently smart compiler could optimize it to the speed of hand
written C code (in theory!). 

Even if we use the "state based" definition of OO proposed by some here,
I'd still argue that STL doesn't fit. I can achieve the same goals in 
SML or OCaml using the module system, which has structures, signatures, 
and functors (Ada 95 fans read packages, generic signature packages, and 
generic packages with formal package parameters respectively :-). I might 
lose some of the mutating capabilities, but I could easily write a
functional STL in one of the MLs.

> If I were to choose Ada 95 for OO programming I would have a safer
> program, at the expense of more obscure OO syntax. So, in order to use
> the syntax that I prefer, ie. C++, I need to find ways to make C++
> programs safer and one way is to use the STL. 

Yes, that's true.

> > I suppose I could be convinced that C++ is more convenient for a "pure OO"
> > style of programming than Ada. Let's see those examples...
> 
> I have posted one example. I guess it comes down to how important you
> think programming elegance is, compared to intrinsic safety. I feel I am
> experienced enough in C++ to be rarely caught out, but I admit there are
> some nasty gotchas!

I'd rather the language defaulted to "very safe" and allowed you to be 
unsafe with some extra effort. I think C and C++ are the opposite. Also, 
there are lots of (non-OO) things that are more elegant (IMO of course) in
Ada than C++, though I admit that Ada support for MI is weaker than
C++. I am very glad to hear Tucker Taft mention that Java style
interfaces (or GNU C++ style signatures :-) are being considered for a
future Ada. 

BTW, I don't consider C++ a swear word, and unlike many Ada folk I do
appreciate that the implicit instantiation (well, some of it) of templates 
can enhance readability. But for "safety critical" software? I skept. 
Those nasty gotchas you can avoid may not be so easily avoided by less
competent programmers like me.

-- Brian








  parent reply	other threads:[~1999-12-14  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 ` 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         ` Richard D Riehle
1999-12-14  0:00           ` Chris Powell
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-14  0:00             ` Richard D Riehle
1999-12-14  0:00               ` Matthew Heaney
1999-12-14  0:00             ` Simon Wright
1999-12-15  0:00               ` Chris Powell
1999-12-15  0:00                 ` Robert A Duff
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               ` Ted Dennison
1999-12-21  0:00                 ` Robert Dewar
1999-12-21  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 [this message]
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         ` 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             ` 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-12-14  0:00             ` Stephen Leake
1999-12-23  0:00               ` Chris Powell
1999-11-26  0:00 ` Andreas Winckler
1999-11-26  0:00 ` Preben Randhol
1999-11-26  0:00   ` Preben Randhol
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