Tuesday, 29 March 2011

C++ has not jumped the shark

I love John's blog. If you are not subscribed, you should be subscribed. He is one of my favourite bloggers as I actually learn something when he posts.

Somehow, I managed to miss his post on C++ going about as far as it can go in its evolution. Fortunately, it showed up on YCombinator News a few days back so I got the chance to catch up.

From my reading, John is concerned about the following:

  • The language has stopped evolving because it is too long between revisions of the standard.
  • He doesn't need anything new therefore new features are not useful for him.
  • Something about concepts.

I don't intend on refuting or accepting those points as that's not what this is about. I just wanted to give a short summary. Also, I'm not really that interested in concepts but that is no reason to not include them. I'm sure I would also have said "TEMPLATES? WHY DO WE NEED THIS COMPLEXITY?!!!!"

The current C++ standard has been greatly influenced by the various Boost libraries. From lambda to thread, the influence of the Boost development experience is obvious, if not prevalent. Boost made it easy to decide what libraries to include. After all, we've had a few years of practical experience with them.

Reading the list of libraries in first-released order, there are a lot of libraries for various holes in the standard library. The Wikipedia article on the Boost libraries makes it much more clear as to where Boost development has been focused.

There is another trend: the number of libraries dealing with language issues has steadily decreased over time. Now, that is not to say that there will not be another set of C++0B libraries, there probably will. But I don't know if it will trigger the same kind of innovation.

So if that is all true, is C++ over?

In the last few years, there has been a gigantic evolution in C++-land: Clang. I have been fortunate enough to spend some quality time with Clang in the last little while and I have to say that I have enjoyed it a lot more than the last time I spent some time with another open-source C++ compiler.

With Clang, it is reasonably easy to add new features, even easier to add features that translate into combinations of existing features.

So while it was straightforward to add library changes to C++0B due to Boost, it was a lot harder to do the same for language syntax because there was no real experience with many of the proposed features.

Clang can enable, for the language, what Boost enabled for libraries.

However, I don't think Clang is really at the point from an organizational and technical perspective where it can enable and manage the kind of innovation that Boost was able to oversee.

That being said, I look forward to its role in the future of C++. I think it's a bright one*.

* Someone please make C++0B lambda polymorphic.