C++11?
The C++0x standard has been approved by ISO/IEC. This probably means that we’re going to be calling this iteration of the language C++11.
It amazes me how much of the language and the standard library people don’t use already. And I mean the C++98 stuff that has been around for 13 fracking years! True, there are professional developers that decide to use a specific subset of the language, or in some situations some design decisions are “inherited” by programmers working on an existing body of code… but I’m not bitching about them (much!) I’m talking about programmers and their new projects and sample code. New programmers (usually university or high school students) don’t learn about most of C++ because their teachers don’t know them and that almost all programming books on C++ suck (sometimes, it’s not the author’s fault; C++ is just too vast and complex.) More “experienced” programmers usually learn about a subset of the language and form a “comfort zone” and stay in there; because anything out of that zone will upset them. The bad thing is that this C++ comfort zone is – more often than not – way too small.
It might (or might not) include good polymorphism and class hierarchies (which I don’t like, incidentally) but almost always it does not include any meaningful use of generic programming, higher order and (some vestiges of) functional programming, attention to memory and layout (I believe many non-trivial programs have ran or are running into address-space limitations as we speak,) exception-safe and exception-correct programming, development of domain-specific mini-languages, real scalability and thread-correctness, etc.
Of course, everybody is free to program the way they want or can. I’m not the one to judge. All I’m saying is that even in the single language we use, there is much that we don’t take advantage of (let alone using other languages that might be more suitable for a job.)
Now, enters a new and feature-rich standard of C++ into an already starved expertise pool. There are so many real features and improvements in this iteration of the standard that they could overwhelm at the first glance. There is (just off the top of my head) r-value references and perfect forwarding, lambdas, variadic templates, compile-time constant expressions, user-defined literals, better enumerations, typedefing templates, initializer lists, better control over inherited methods, better control over compiler-generated class methods, finally some semblance of class- and method-specific directives (alignment, etc.,) extern templates, forwarding constructors, initializing class data members upon declaration, auto and decltype keywords for type inference and whatnot, (oh, I almost forgot!) the cool and hip new way of declaring the return type of a function, and much more.
The above features are just the ones that I could recall right now and in the core language only. I need and want to use these features, additions and improvements right now. They all make my code better and my life easier. These are not some obscure features for practitioners of “black magic”. They benefit the likes of you and I, not language lawyers, but people with real applications and real problems.
I guess what I’m saying is that as a C++ programmer, you should not be afraid of experimenting with the new features today. Don’t wait for the books or libraries and frameworks to pick them up. Books will take years and they will be all wrong and useless anyways (of course, with a couple of stellar exceptions.) Again, only with a few exceptions, libraries and frameworks will be burdened with incompetence, corporate politics, backward and forward compatibility and compiler compatibility (with the most brain-dead compilers. Please don’t rely on Qt or wxWidgets or whatever to do your C++ for you. Please don’t wait for Deitel and Deitel to teach you C++.
Start with Wikipedia. Read various texts and tutorials and overviews that uncle Google finds for you. Start experimenting and teaching yourselves the new features of C++11; and any of the old feature-set that you might be rusty about. It’s a great time for C++, as it is now a better language than it ever was. It’s probably the best general purpose programming language out there for people with actual hardware limitations on their applications. And it can do practically everything. (Also, C++ supports the widest range and mixture of programming paradigms of any programming language that I know of.)
Notes: I have three points to add to the above rant.
First is about the advancements in the standard library. They are much more substantial and accessible for the lazy programmer (I don’t use the term “lazy programmer” as a negative phrase!) as most of the additions are already available with the most popular compilers, or even in Boost if your compiler doesn’t have them yet or if you don’t like your compiler vendor’s standard library! I’m much less enthusiastic about the new C++ standard library features simply because most of them have been available as part of Boost for years and therefore are hardly new. Still exciting, though!
Second. No compiler that I work with has support for all or even most of the new core language features, although GCC is close (not to “all”, but it is close to “much”.) The state of support in Microsoft’s Visual C++ is closer to pathetic. Intel C++’s condition is not much better either. A partial table of the state of support for various new features of the language across quite a few compilers can be found here. Right now, I (and probably everyone else) would suggest using GCC. Get your hands on 4.7 if you can, or use 4.6 or even 4.5. Good luck!
It seems that I’ve forgotten my third note! Maybe it’d come to me later.
