Linked by Christopher W. Cowell-Shah on Thu 8th Jan 2004 19:33 UTC
General Development This article discusses a small-scale benchmark test run on nine modern computer languages or variants: Java 1.3.1, Java 1.4.2, C compiled with gcc 3.3.1, Python 2.3.2, Python compiled with Psyco 1.1.1, and the four languages supported by Microsoft's Visual Studio .NET 2003 development environment: Visual Basic, Visual C#, Visual C++, and Visual J#. The benchmark tests arithmetic and trigonometric functions using a variety of data types, and also tests simple file I/O. All tests took place on a Pentium 4-based computer running Windows XP. Update: Delphi version of the benchmark here.
Permalink for comment
To read all comments associated with this story, please click here.
IF C++ really is a superset of C...
by Anonymous on Fri 9th Jan 2004 15:58 UTC

It's not. C++ just looks like C because it was felt that it would make it more familiar to programmers. Originally Stroustrup's work focused on adding syntactic sugar to support OO programming with C. At this point it was a strict superset, and Stroustrup used ordinary C compilers along with a pre-processor.

Fast forward a few years and the language is much more complicated and has acquired the name "C++" despite objections. It has also escaped AT&T and is now the "next big thing". Unfortunately standardisation, and compiler quality still leave a lot to be desired.

An unfortunate side effect, especially outside Unix, was that people took C++ to be "C, only better" and began to insist that good C programs be re-written as bad C++ programs. Since C was in fact standardised, portable and had a working ABI, while C++ had not (some would say still has not today) these things, the cost was uncountable.

There's a section in Stroustrup's book "The C++ language" which confirms that in fact C++ is not a superset and was not intended to be. Since ISO C9X is actually newer than the C++ split, it has features which aren't present in C++ at all. Some programs are valid C and valid C++ but mean different things in each language, a recipe for disaster.