C++11 first impressions

I’ve been embroiling myself in C++11 lately, and have to say I like this version of the C++ language a lot more than I’ve liked previous versions. A lot of the rough edges have been cleaned up and there’s some powerful new features as well.

The Upsides:

  1. They did a good job at pulling in a lot of the ‘less controversial’ parts of boost into the STL. Its just easier when you don’t have to juggle STL and boost, and can just use the STL in a lot of cases.
  2. Spawning a thread is now pretty easy and clean. Thread synchronization mechanisms are very easy to access and clean as well.
  3. “smart pointers” are growing on me. My C background made me a bit skeptical at first about this memory management model, but I’m beginning to trust them more, and can see some benefits.
  4. Move semantics are a pretty cool idea for managing memory. It’ll be interesting to see how that pans out in the greater software ecosystem.

The Neutrals:

There are a lot of points about the new standard that I feel pretty neutrally about. They’re nice to have, but I might not use them that often, like new STL data types or STL regular expressions support.

The downsides:

  1. Although I’ve come to an understanding with them, r-value vs l-value references are somewhat obscure to understand. I wouldn’t like to be a new programmer learning about this in Computer Science 102 again!
  2. Compiler support is still coming along, slowly but surely. GCC 4.7 has most of the critical features, but coding with all of the C++11 feature set is still not supported, and (worse yet) I wouldn’t consider the STL support “fully trusted”.
  3. All the other objects to C++. 🙂 C++ isn’t short of its detractors. I’m not interested in a compare-contrast with other languages in this post, just sharing my findings about C++11

Overall, I think that C++11 is a good improvement/evolution of the C++ standard. It’ll be interesting to see how code in the wild looks under c++11!

One Comment

  • Prem

    Interesting post. You have a real gift for being able to explain technical stuff in a way that it is easy for ordinary people to grasp.

    It took me a while to figure out what wayland actually does and your articles on wayland clearly and concisely explained that.

    Also, this article on C++11 is also really easy to understand.

    Thank you for your articles. Keep them coming!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.