I like C++. There, I said it. And I swear I won’t qualify that declaration for at least three paragraphs.
After eight years of work, the C++ Standards Committee recently voted the C++0x standard forward to formal adoption voting. The “0x” appellation was ironically adopted as a nod to the glacial pace of standards committees in general and legacy programming language committees in particular.
Unlike many standards, the C and C++ languages are widely produced; there are literally hundreds of C and C++ compilers (although many at this point use the same components and libraries), and it is claimed that the amount of C and C++ “in the wild” approaches a billion lines of code. One can be certain that somewhere in that vast body of code, there are critical routines that rely on every subtlety of the previous standards, that every “MAY” is routinely ignored, that the most arcane combinations of “MUST” are relied upon, and, just to be fun, vast swaths of the code rely on “undefined behavior” continuing in the way it did before (the committee MAY make a breaking change to a widely implemented “undefined behavior,” but it is hesitant to do so).
The task of a language standards committee is like the task of writing the season finale for a multiyear supernatural drama, like “Lost” or “The X-Files.” The legacy of past years has to be incorporated (even if, in retrospect, it was just a plain-and-simple mistake) while moving the plot forward in a major way.
For C and C++, the task of dealing with the legacy is made vastly harder by such things as the preprocessor, strings, the memory model and, above all, security. The preprocessor is now used for sophisticated code generation; strings must be treated both as just null-terminated strips of 8-bit integers and Unicode-based typesafe objects; the standard memory model must make sense on virtually any conceivable chip; and the language standard has to do what it can to mitigate the multibillion-dollar problem of buffer-overflow attacks.
That’s just the legacy: moving the plot forward requires that C++ be kept at the top of the list as a language that can be used to program systems in the most high-performing way. No one has been more vocal about the ending of the performance-improving “free lunch” of Moore’s Law than Microsoft’s Herb Sutter, who is the Secretary of the C++ committee. I’ll admit that I hoped that C++0x had gone further with its support for concurrency, but no honest analyst can claim that the path forward is clear.