December 7, 2021

How to Choose Programming Language for UAP? – Updated




This is a short post, because it is a simple question and there is a simple answer. The reason I want this post is: if you ask anyone, you will get a long answer, and that never answers your question. Actually, I have talked about this before (here), but I feel I left Visual Basic out, and something about DirectX needs clarification.

The typical answer you get is: It depends. Then you get a few answers for different situations, and you have no idea what your situation is.

The choices are:

  1. HTML, CSS and JavaScript.
  2. XAML and C#/VB
  3. XAML, DirectX and C++

The answer is: Forget about #1, because it is silly. If you develop apps, #2 is your best choice, because it is easy, time-saving comparing to C++. If you develop games, #3 is your best choice, because that’s pretty much your only choice.

Update: If you want to develop both apps and games, the answer is: it’s still the best to learn both C# and C++. Reasons are: a. It’s not hard to do, because they are very similar in syntax. b. Writing apps in C# is a lot easier than in C++.

You can stop here, because you’ve already got the answer. The following explanations are not part of the answer, and can be ignored.

HoloLens Technology – Eye Tracking

I don’t have problem with JavaScript, as a matter of fact, I am coding it every day, right this moment. But writing serious application in JS is really silly. Microsoft put this up, hoping someone only knows JavaScript won’t have to learn C# or C++. I am not sure if there is a programmer who only writes in JavaScript.

Visual Basic is still supported, that doesn’t mean you should stick to it. I feel Visual Basic is in legacy state, but it’s just how I feel, not that I have any proof. I love Visual Basic. Visual Basic is the start of modern programming.

WinRT programming in C++, without MFC, is not programmer friendly. You don’t need write COM code, but IUnknown, QueryInterface() really turn me off, I have a fair amount of experience in COM programming though. However, C++/CX adopts C# style syntax, which makes it easier. But if you are developing games, you can’t avoid C++ for the moment. The reason is you can’t avoid DirectX.

Xbox + HoloLens: How Can They Work Together?

There was a time, when games can be done in Silverlight and XNA. This has changed to DriectX. At some point, DirectX has interface for .NET, so C# with DirectX worked. Since DirectX 10, there is no official support to .NET. There is no word in DirectX 12, which is available in Windows 10. We will have to wait for BUILD to check this out. There are third party packages that make DirectX work with .NET.  As of now, if you plan to write games, it’s XAML + DirectX + C++.

Do I have to use DirectX to develop games? No, but most games required timely response and deals with a lot of graphics, DirectX is your best bet, even though you are not doing 3D. Can I write apps with XAML + DirectX + C++? Yes. DirectX can be used whenever it fits, but it is not required. DirectX works with XAML as ImageSource or SwapChain.


UAP, HoloLens, Recommended Readings – Developer’s Collection

HoloLens, Recommended Readings – Business Ideas Collection