Re: Why We Use C Than C++...



henryk.mueller@xxxxxx said:

>
> Dag-Erling Smørgrav schrieb:
>
>> > C++ is not faster or slower than C if you DO the same.
>>
>> in which case there is no point in chosing C++ over C.
>
> Well, the point is that you can do a lot more with C++ - if you want!

No, the two languages have equivalent computational power. This is perhaps
more obvious when you realise that you can write a C++ compiler in C or a C
compiler in C++. So anything you can compute in one language can clearly be
computed in the other, too.

<snip>

> I personally really like the beauty and robustness of a lean interface
> wrapper class that looks very sophisticated from the outside but
> actually contains only a lot of inline stuff that gets and sets some
> port registers...

That's precisely the wrong use for C++. A good C++ class (or C module)
should be like a duck - calm and smooth on the surface, and paddling
furiously underneath. Clean interfaces are much to be preferred to
"sophisticated" interfaces. "Sophisticated" is just another word for "hard
to use and therefore bug-prone".

> For my part, I think that plain C just looks ugly and is so damn old
> school... ;o)

Aesthetic appreciation is notoriously non-portable.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
.



Relevant Pages

  • Re: Why C?
    ... > C programs can be as fast as a compiler can make them, ... > programs in other languages. ... > lurking bugs and inappropriate data types in any existing C code. ... With only a different declaration syntax it would be much ...
    (comp.os.linux.development.apps)
  • Re: Why do folks implement statically typed languages?
    ... The languages discussed are extremes. ... It allows the compiler to prove that your data-manipulations are ... an IDE for a dynamically-typed language can ... to IDEs in dynamically-typed languages. ...
    (comp.lang.scheme)
  • Re: Why is C good??? any experts?
    ... it to maintain someone else's code is a completely different matter. ... > hodge-podge of exported subroutines and messy global variables. ... Compilers and, to a lesser extent, languages ... For example, to compute any algebraic expression, a compiler will ...
    (comp.lang.c)
  • Re: OO compilers and efficiency
    ... > will be difficult for a compiler to do a good job of spotting when the OO ... "simpler" languages, ... I agree that Java ... (including adding lexical closures) ...
    (comp.programming)
  • Re: Delphi 2008 native?
    ... That's a function of the particular compiler you use. ... Once upon a time there were a number of languages you could use to write ... Very impressive I'm sure, all that hardware grunt. ... but society places value on humans remaining in touch with reality. ...
    (borland.public.delphi.non-technical)