From: Paul Rubin on
Michael Torrie <torriem(a)gmail.com> writes:
> Sometimes, C++ is just the right tool for the job, despite all its
> warts.... C++'s object semantics (guaranteed destruction, scoping,
> etc) can sometimes work very well when you need the speed of a
> compiled language, but don't want to be quite as low-level as C.
>
> In this case, C++ is certainly not a better tool for the job than C.

The stuff C++ adds to C is a mix of good and bad, and it's reasonably
possible to use just the good stuff and ignore the bad. At that point
you've got a pure improvement over C, although a lot of C's shortcomings
can't be papered over and still remain.

Certain folks in the functional-programming community consider OO to be
a 1980's or 1990's approach that didn't work out, and that what it was
really trying to supply was polymorphism. C++ programs these days
apparently tend to use template-based generics rather than objects and
inheritance for that purpose.

I've never programmed in Ada but I'm intrigued by these articles:

http://adahome.com/Ammo/cpp2ada.html
http://www.adaic.org/whyada/ada-vs-c/cada_art.html

I have the impression that Ada has an undeservedly bad rap because of
its early implementations and its origins in military bureaucracy. I'd
certainly consider it as an alternative to C or C++ if I had to write a
big program in a traditional procedural language.
From: sturlamolden on
On 2 Aug, 05:04, Tomasz Rola <rto...(a)ceti.pl> wrote:

> And one should not forget about performance. C++ was for a long time
> behind C, and even now some parts (like iostreams) should be avoided in
> fast code.

For fast I/O one must use platform specific APIs, such as Windows' i/o
completion ports and memory mapping.

iostreams in C++ and stdio in C are ok for less demanding tasks.


From: sturlamolden on
On 3 Aug, 00:27, Paul Rubin <no.em...(a)nospam.invalid> wrote:

> Certain folks in the functional-programming community consider OO to be
> a 1980's or 1990's approach that didn't work out, and that what it was
> really trying to supply was polymorphism.  C++ programs these days
> apparently tend to use template-based generics rather than objects and
> inheritance for that purpose.  

It avoids virtual function calls at the expense of unreable code and
errors that are nearly impossible to trace. It seems many thinks this
is a good idea because Microsoft did this with ATL and WTL. There are
also those who thinks template metaprogramming is a good idea. But who
uses a C++ compiler to dumb to unroll a for loop? In my experience,
trying to outsmart a modern compiler is almost always a bad idea.

> I have the impression that Ada has an undeservedly bad rap because of
> its early implementations and its origins in military bureaucracy.  

It is annyingly verbose, reminds me of Pascal (I hate the looks of
it), and is rumoured to produce slow bloatware. And don't forget
Ariane 5 ;)


> I'd
> certainly consider it as an alternative to C or C++ if I had to write a
> big program in a traditional procedural language.

I still prefer Fortran 95 :-)







From: Aahz on
In article <f9e652d6-3945-4c18-92f3-b85b994feb0b(a)k8g2000prh.googlegroups.com>,
Peter <peter.milliken(a)gmail.com> wrote:
>On Aug 3, 7:42=A0am, Mark Lawrence <breamore...(a)yahoo.co.uk> wrote:
>> On 02/08/2010 00:08, candide wrote:
>>
>> I can't understand why any serious programmer mentions C++. As soon as I
>> read it, I have to rush either to the kitchen to find a bowl to throw up
>> in, or head for the toilet so I can talk to the great white telephone.
>
>With you there Mark - IMO C++ is an abortion that should never have
>seen the light of day. The idea of experimenting with creating an OO
>language by extending C wasn't such a bad idea for a "play thing" (by
>Stroustrop) but the fact that it somehow escaped from the Lab and
>people picked it up and ran with it on a commercial basis is just
>plain wrong!

http://www.netfunny.com/rhf/jokes/98/May/stroustrup.html
--
Aahz (aahz(a)pythoncraft.com) <*> http://www.pythoncraft.com/

"....Normal is what cuts off your sixth finger and your tail..." --Siobhan
From: Martin Gregorie on
On Mon, 02 Aug 2010 15:54:52 -0700, sturlamolden wrote:

> On 3 Aug, 00:27, Paul Rubin <no.em...(a)nospam.invalid> wrote:
>
>> Certain folks in the functional-programming community consider OO to be
>> a 1980's or 1990's approach that didn't work out, and that what it was
>> really trying to supply was polymorphism.  C++ programs these days
>> apparently tend to use template-based generics rather than objects and
>> inheritance for that purpose.
>
> It avoids virtual function calls at the expense of unreable code and
> errors that are nearly impossible to trace. It seems many thinks this is
> a good idea because Microsoft did this with ATL and WTL. There are also
> those who thinks template metaprogramming is a good idea. But who uses a
> C++ compiler to dumb to unroll a for loop? In my experience, trying to
> outsmart a modern compiler is almost always a bad idea.
>
>> I have the impression that Ada has an undeservedly bad rap because of
>> its early implementations and its origins in military bureaucracy.
>
> It is annyingly verbose, reminds me of Pascal (I hate the looks of it),
> and is rumoured to produce slow bloatware.

> And don't forget Ariane 5 ;)
>
This had nothing to do with Ada per se and everything to do with
shortcuts:

- re-use of an Ariane 4 component without changing its parameters
to match the Ariane 5 flight profile
- not removing Ariane 4-only code intended to handle launch holds
and not used at all in Ariane 5
- a programming fault that allowed an exception code to be sent
to another component as if it was valid data.

Inadequate testing allowed all these to be flown without finding the
errors.

Bottom line: All this would still have happened regardless of the
programming language used. However, don't just listen to me: read the
final report on Ariane 501 here:

http://www.di.unito.it/~damiani/ariane5rep.html


--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |