I just read the article on C++0x in Wikipedia. C++0x is the “codename” for the next generation of the C++ programming language.

Well, call me a skeptic, but I’m hardly convinced by the general direction C++ has taken. It’s really too complex, there is almost one keyword per new feature. Even then, too often, the proposed syntax is simply puzzling. The C++ committee members are smart people, so there were probably good reasons related to the legacy of C++. But still…

Consider for instance the template typedef feature. The following syntax just seems bizarre to me:

template< class T > using Vector =
    MyVector< T, MyAlloc<T> > ;
Vector<int> int_vector ;

I can understand why a purist would want not to call it a “typedef”, since we are not dealing with a type but with a template. But using an equal sign to define a template, now that’s new… It’s not even consistent with any other template syntax.

In a sense, I’m really glad to no longer participate in the C++ committee. It’s not that I want to distance myself from committee members (I still have a few good friends there). But I really don’t want their job, it’s not fun to try to improve C++. It’s really tough, because the language is just too big and too inconsistent.

There are still some ideas that I like in there (with, in most cases, implementations I personally find ugly). I like to think that I had an influence on this: a few leading C++ committee members, including Bjarne Stroustrup, were very well aware of XL and concept programming. I know, because I wrote to them and argued about some XL features. This is only my opinion, Daveed Vandevoorde may not agree with me.

For example, I believe that variadic templates were not in the C++0x slides until after I sent an e-mail about the equivalent feature in XL in September 2001. Again, I may be wrong on this. It is also fairly possible that they were invented independently, if only because they had been in XL for a while (the linked test passed in August 2001, but the feature had apparently been implemented in August 2000). Actually, variadics is one case where C++0x influenced XL, because XL was using an other keyword at the time, which I replaced with ... after a discussion on the C++0x syntax.

But the case for “concepts” is a bit more annoying. I remember writing another e-mail where I tried to explain concept programming. I may very well have taken the example of what is called generic validation in XL. And maybe someone genuinely thought this was what I had in mind when I talked about “concepts”. Sadly, it is not. Concepts (in my original interpretation) are all about bridging the gap between the problem space and the code space. Specific language constructs are tools to implement concepts, they are not the concepts.

Unfortunately, I’m afraid that he future evolution of C++ will make explaining my ideas about programming much more difficult than today. Not that it was any easy today…


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s