C++ 11 is approved by ISO: a big day for native code development

Herb Sutter reports that C++ 0x, which will be called C++ 11, has been unanimously approved by the ISO C++ committee. The “11” in the name refers to the year of approval, 2011. The current standard is C++ 98, though amended as C++ 03, so it has taken 8 or 13 years to update it depending on how you count it.

This means that compiler makers can get on with implementing the full C++ 11 standard. Most current compilers implement some of the features already. This Apache wiki shows the current status. A quick glance suggests that the open source GCC is ahead of the pack, followed by Intel C++ and then perhaps Microsoft Visual C++.

C++ 11 is pretty much compatible with C++ 03 so existing code should still work. However there are many new features, enough for Bjarne Stroustrup to say in his feature summary:

Surprisingly, C++0x feels like a new language: The pieces just fit together better than they used to and I find a higher-level style of programming more natural than before and as efficient as ever. If you timidly approach C++ as just a better C or as an object-oriented language, you are going to miss the point. The abstractions are simply more flexible and affordable than before. Rely on the old mantra: If you think of it as a separate idea or object, represent it directly in the program; model real-world objects, and abstractions directly in code. It’s easier now.

Concurrent programming is better supported in C++ 11, important for getting the best performance from modern hardware.

It is curious how the programming landscape has changed in recent year. A few years back, you might have foreseen a day when most programming would be .NET, Java or JavaScript: all varieties of managed code. While those languages do still dominate, native code has come more to the fore, thanks to factors like Apple’s focus on Objective C, and signs of internal conflict at Microsoft over the best language for coding Windows applications.

That said, C++ 11 remains a demanding language to learn and use. As Stroustrup notes, since C++ 11 is a superset of C++ 98 it is technically harder to learn all of it, though new libraries and abstractions should help beginners. The reasons for using or not using C++ are not going to change significantly with this new standard.

4 thoughts on “C++ 11 is approved by ISO: a big day for native code development”

  1. The drive for C++ isn’t so much Apple’s objective C as it is that performance has become a feature. We can debate forever that Java is as fast as C++, but at the end of the day the resources C++ uses is always more tweakable. It will have a smaller memory foot print, tolling the system less, it will have a faster startup time, it will have a slight larger download size, but that is less of a problem these days. C++ is also more portable(!) than Java/.Net in this world of SoC, embedded platform and other devices.

    With the right copy/take ownership operator in C++ one of the larger annoyances for APIs will be removed as you can now safely allocate memory once in an API (much like GC languages) and give that reference out. Lambdas add to STL much like anonymous classes got people hooked on java.

    Now, if we just got simple and efficient texthandling/regex in C++ ..

  2. It was already possible to run QT apps in a browser through the NPAPI/ActiveX, there are even a sample plugins for this in the QT source tree. Funny though, activeX plugins are seen as bane, but Google Native client would suddenly be cooler? =)

    I still hope it catches on, Apple at least showed that performant and thin software sells, and using a VM on top of a VM(CPU) of a turing model seems like a waste. To have C++ (or any other native language) recompiled for more than one platform is easy, no effort even (except some initial), as all you have to do is to tell your build system to build X binaries instead of one. At least if your code is built right.

Comments are closed.