Thursday, November 15, 2012

A public letter to Microsoft about the CTP.

Dear Microsoft,

I see that you have decided to release C++11 in the form of a CTP. Congratulations on catching up! For a long time, it seemed like you just didn't give a shit, but thankfully that's not true.

I see you now offer variadic templates. Great! You know when GCC 4.3 came out offering back in 2008, and Clang 2.9 the April of last year, it was really amazing, so I'm glad to see you're offering this too now. It's really something that developers chained faithful to MSVC will finally be compiling code written with GCC years ago!

Initializer lists, too!? Wow! How nostalgic. Like when GCC 4.4 came out in '09. Oh, but you can't use it for std::vector? How silly. Well, I'm sure it's just one of those things you'll get around to in the same way you finally got around to C++11. There are probably some major complexities that I am not aware of for integrating this feature into the standard library.

You also now offer delegated constructors. It took GCC a long time to implement that! It only happened earlier this year. Clang didn't even have it until December 2011. Being only a year behind must feel like a major accomplishment. The whole team who implemented this should be promoted for their unusual efficiency.

My, my, default template argument for functions was a huge oversight for the standardizing committee. It's a good thing they corrected themselves, allowing GCC to include it in their 4.3 release series. It's good to see you have also corrected yourselves by including it in your CTP. Developers of MSVC will finally be able to write

    template< class X, class Y = type-exp >
    Y f( X x ) {return Y(...); }

instead of what we used to have to write:

    template< class X >
    type-exp(...) f( X x ) { return type-exp(...); }

Remember how it took GCC until 4.5 (April 2010) to get explicit conversion operators in, and Clang until 3.0 in December 2011? Well now MSVC developers too can take advantage of the fact that allowing smart pointers to explicitly convert to bools won't allow them to then convert to ints!

    std::unique_ptr<int> p( new int(6); );
    if( p ) { } // Explicit conversion!
    p + p; // Not allowed!

Have I forgotten a feature to applaud you for? Oh yes, raw string literals! Good job. Not the first here, either, but hey, it's not like you're competing for market share, right? After all, you already got it. Developers are locked in, aren't they? They have do use MSVC to develop professionally for Windows, right? Isn't that the idea?

Now, it would be absolutely horrible if you released all these features that the rest of the C++ community has been using for years and none of your customers knew any of it. So how wonderful it is that you have channel 9 where you have been publishing videos like Scott Meyer's influential Universal References talk and Herb Sutter's (who works for you) talk on the future of our langauge and Lavavej's core C++ course. Your parade of C++ intellectuals surely adds much to the discussion. I wonder: did they use your CTP to research those talks, GCC, or Clang?

So thank you, Microsoft. Thanks for holding the C++ community back several years. Thanks for offering educational content on these features, now that you finally decided to implement them. Thanks for parading all the C++ intellectuals in our faces to get us excited about these features, now that you offer them. Thank you for showing that you really care about advancements in C++, in your products. Thank you for demonstrating that you care about the advancement of the C++ community at-large, when they're using MSVC. Thank you for dishing out pieces of C++11 like chocolate rations. And thank you for hiring Herb Sutter back in 2002, which obviously made you hurry much faster in releasing C++11 features.

Thank you for being you. Without you, we'd all be programming in C++11! That would be insanity.