C++/CX: Not a simple love or hate

Standards are important. Standards makes it clear what to expect or what is expected of you. If you are still wondering what I am talking about, well then a bit of an explanation follows: I am talking about official standards as published by a Standard Organisation (such as ISO etc…). I want to quickly give my brief opinion C++/CX, a small deviation from the C++ standard, where, in my opinion, it is not quite clear cut whether the decision to deviate from the Standard was a good thing or a bad thing.

C++/CX, according to the Microsoft site (here), is a set of extensions to C++ that are targeted at Windows Store and Windows Runtime development. I came across C++/CX when I was reading some Windows 8 development tutorials and have not yet used it very much. My first thought was “why? oh why do you do this to us?”. Why not just make use of standard C++? First of all the applicability of a Standard in the context of Windows Runtime development isn’t as important since we are confined to that specific context. The applications developed are not aimed at being cross-platform, and developers are not likely to try and use a different compiler (although sometimes that might still be nice).

But there are other reasons that maybe we should stick to the Standard? How about the fact that a C++ developer has to now contend with and learn new language constructs that wouldn’t normally be seen in a C++ program? The other side of this argument is that experienced developers normally have no issue coming to terms with new programming languages (and since C++/CX introduces new syntactical elements is has to be defined as a altogether different language).

Maybe something can be found if the reasons for such a deviation can be inferred. This is trivial – the deviations have introduced new language features obviously intended so that developers do not have to cobble a lot of code together for elements that occur frequently in Windows Runtime programs. I have found some of these features to be interesting and potentially useful (interfaces, accessor methods etc.)

So where does this leave the issue? I think it leaves it in a fairly grey area. Deviations or extensions in this manner add a bit of diversity – as such, some of the features might be considered for the actual standard (just as many of the constructs in Boost have been added into the Standard C++ library). I don’t think we should fault developers for augmenting the tools available so as to have the tools they need. Yes, it can be frustrating sometimes if it is (basically) forced upon us by a big corporate giant. However in this case you have a choice (C#, Javascript, C++). The inclusion of Javascript deserves sidetracking from the main topic, and so I shall finish with it. Javascript’s inclusion tells me that Microsoft seems to be taking note of global trends these days instead of trying to beat the trends into submission and set their own. There are more and more examples of this including but not limited to the inclusion of Node.js into the Azure platform and more recently the integration of git into Visual Studio and Team Foundation. I kind of like the initiative, whether it is an elaborate marketing ploy to lure in new developers or not – time will tell.

3 Comments

  1. Interesting read, though i think that there will never be a one tool fits all or more directly one language fits all. If you want to make your app get the best experience in all operating systems then its best to use the native code for that platform(OS X xcode, windows c#,linux (python,c++)) because it provides the best integration into that Eco system. I am leaving java out of this since some operating systems( mac osx specifically) is going as far as to disable java by default since the amount of security holes in the system. I like to use C++ as a base learning block and a introduction to all the different languages.
    Good luck getting Microsoft to play and comply with ISO standards look how long it took them to play with the w3c web standards only now is their IE9 something of a decent web browser.

    Reply
  2. I have no problem to learn those new features of c++11, to tell you the truth, I like c++11 so much, it is a much more better version than c++03.The field of programming is rapidly evolving, we have to be a quick learner to pick the new skills, and good at “unlearned” those obsolete coding styles(or technique, whatever).Do not afraid of change, try to understand why the techniques evolve by the way they do could help you write better codes.

    Reply

Leave a Comment.

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