C++: Stroustrup – C++11 Style – A Touch of Class

With my increasing interest on C++11, this keynote that Bjarne Stroustrup gave at Going Native 2012, was an interesting lecture (fully available on YouTube)

This was not a technical presentation of C++11 (for this he recommended the C++11 FAQ page), but more of a high level view on the language, from the style point of view.

He started with the classical C style qsort(), and its inherent inefficiencies compared to the modern sort(Container&) version, referred to the possibility of representing SI units using the new suffix operator, introduced the RAII (Resource Acquisition Is Initialisation idiom) to avoid resource leaks, presented some examples with various pointers (shared, unique) and suggested, if possible, not to use pointers at all.

The presentation continued with return by-value, using move rather than copy, with a Vector vs List comparison (Vector being the preferred container), an argumentation on using algorithms vs. code with loops and tests (and in general that low level does not necessary equal efficiency).

He warned on inheritance (seriously and systematically overused and misused), and finally mentioned some concurrency issues and recommended the ISO C++ standard library.

The session ended with about 30 minutes of questions, some of them quite interesting too.