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


Developers: Get Yourself Ready for HoloLens


There is no question that HoloLens presents great opportunities for developers. Getting on the platform early is even a bigger deal. As we’re all aware once a platform get crowed, it’s very difficult for an app to get attention in the market place. The BUILD conference is just a little more than a month away, we will hear more about Windows Holographic and HoloLens. Windows 10 SDK will be released at the time, which will include details about Windows Holographic API and how to write code for HoloLens. Before getting to that, we need get ourselves ready. In this post, I am trying to help with that.

What Should I Do to Develop a Holographic Application?

Nothing. Remember this,

 All Windows universal apps work as holograms.

This is direct quote from Microsoft’s So, you can take my word for it. If you are writing a Windows 10 universal app, you are writing a holographic app. If there is any chance you get confused by this, let me explain: Holograms and 3D are totally different things. A Hologram can be 2D or 3D. A Hologram is simply a digital objects added to the user’s real world. They can be placed, pinned anywhere in the user’s field of view. Of course, if you want to build 3D holograms, there is extra work. In short, if you want to write an app(2D or 3D) that will work on HoloLens, you write a Windows 10 universal app. Windows universal app doesn’t start from Windows 10. It is already there for Windows 8.1 and Windows Phone 8.1. So, you can get information from Windows Dev Center.

Two Important Questions About HoloLens

What Programming Language Should I Choose to Develop a Holographic Application?

Basically that’s the question you would ask about developing a Windows universal app. Here is a post from Microsoft about the topic. But here I will give you an digested, more useful answer.

Here are the choices:

  • HTML, CSS and JavaScript.
  • XAML and C#
  • XAML, DirectX and C++
  • DirectX and C++

First, I want to vote NO to JavaScript, so did most developers. JavaScript is just a big mess. I am not a big fun of going 20 years back and crafting every UI by hand. HTML and CSS are just not programmer friendly. Not to mention there are limitations comparing to C++ and C#.  #2 and #3 are basically your choices. XAML has been the official UI construction language for Windows and Windows Phone. It is proven to be powerful and easy to use. So, it comes down to this: C# vs. C++/DirectX. The former is easier, the later gives more control over WinRT and DirectX. If you have to deal with a great deal of graphics especially 3D, C++/DirectX would be the choice. Otherwise, C# will serve you well, and save you a lot of time.

What If I want to Develop 3D Holographic Applications?

Many people say the whole point of HoloLens is 3D. Well, yes and no. In any case, if you want to learn how to write 3D holographic code, you have to wait until BUILD. I have managed to get some bits from Windows 10 preview, that says nothing about 3D programming, but that’s how much I know for now.

HoloLens Misconception – 3D

What Should I do Now?

Before Windows Holographic SDK is ready, If either of these: XAML, C#, C++, DirectX doesn’t make prefect sense to you, head to Windows Dev Center, find a tutorial and some sample projects. Also, browse topics about developing Windows universal apps.

HoloLens: Some Early Bits for Developers

There are hints there might be a emulator for HoloLens, just like the emulator for Windows Phone, but I am not sure. Also, Wired have said Microsoft is planning to bring HoloLens to devs hands in this spring. Hope that turns out true.


Some Business Ideas with HoloLens – (8) Holo-Movie
Some Business Ideas with HoloLens – (7) Holo-Escort
Some Business Ideas with HoloLens – (6) Holo-Online Store