Programmers' Toolbox

C++/WinRT not yet ready to replace C++/CX

submitted on 2020-03-14

Given that Microsoft has been talking for quite some time that C++/WinRT is the replacement for C++/CX, I have decided to give it a go.

So for starters I went to MSDN, which has quite a rich set of documentation regarding C++/WinRT.

Given that my focus are graphical interfaces, I decided to follow along with their Bookshelf tutorial.

So while it appears that C++/WinRT has come a long way since Microsoft decided to adopt the initial project, it still needs to evolve quite a bit to match C++/CX tooling on Visual Studio.

Some of the issues that I find that downgrade the C++/CX developer experience while using C++/CX are:

  • Midl files have to be manually taken care of, while C++/CX just handles them for us;
  • While we are forced to edit them manually, no support is provided in form of syntax highlighting or Intelisense;
  • We are forced to manually copy generated code from Mdil compiler output into the respective translation units;
  • Making use of {Binding} requires manually adding more boilerplate;
  • For whatever reason, the team is quite into east const, so we get it everywhere now;
  • I thought Hungary notation was gone, apparently the examples are keen in using stuff like m_ prefixes, as if this did not exist.
  • Even Microsoft libraries like Win2D have integration issues with C++/WinRT.

Given its current state I would rather advise Windows developers that have C++/CX codebases to keep using it, and regularly check on C++/WinRT tooling improvements, if any.

As it stands it feels more like a downgrade on tooling experience, with plenty of room for improvements.