Normall I am a huge C++ advocate but…
I have to say that C++ looks great on paper and even in theory. I have
used stuff that is supposed to work a certain way many times in C++.
Borland C++ for example had a couple versions of string that do copy on
write and therefore incorrectly modified data that should have been
protected.
Even GNU G++ has an example that breaks the compile.
Its perfectly legal C++ code too. <It puts Visual C++ into an infinite
loop during compilation>
It seems that the complexity of what you can do in C++ is the problem. C
is simple. This makes it easier to implement correctly.
I would have to say that I have yet to see a C++ compiler that does
everything C++ advertises it can do or even behaves the
way it should.
Don’t get me wrong I like C++. I just wish those who wrote the compilers
could get it correct. I realize this is a non-trivial task.
So you see the current state of compilers shows that C is better
implemented everywhere while C++ may not work properly everywhere.
DaveOn Tue, 5 Sep 2000, Marc A. Lepage wrote:
jan wrote:
Second, Performance. C is a little closer to the hardware than C++, so the
compiler can optimize more and generate smaller, faster code.
This is a myth, you can use all the same tricks in C++ to optimise you inner
loops as in C, but C++ gives more flexibility for higher level stuff.
I agree with your other points though.
Thanks, I was going to say the same.
C++ is just as performing as C, if not more so, because the compiler is
free to optimize constructs such as virtual tables that are only
implicit in C.
If programmers misuse such constructs, well, that’s not the fault of
C++.
Also, of course, the current state of compiler optimization factors in.
For example, MS has no plans to make VC++ ISO compliant, as evidenced in
their upcoming release (which focuses on C# instead).
–
Marc A. Lepage
http://www.antimeta.com/
Minion open source game, RTS game programming, etc.