Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to choose what technology for a greenfield Windows UWP app? [closed]

The question is super-common. Here's the context; a developer can create a Windows app targeting the Universal Windows Platform (on Windows 10) using a broad spectrum of technologies:

  1. XAML / .Net
  2. XAML / C++
  3. HTML / JavaScript
  4. DirectX / .Net
  5. DirectX / C++

And these exotic approaches:

  1. Cordova / PhoneGap
  2. Hosted Web Apps
  3. Compiled Objective-C
  4. Compiled Android Java (phone-only)
  5. Unity / MonoGame

How is a developer to choose?

like image 765
Jerry Nixon Avatar asked Jul 10 '15 21:07

Jerry Nixon


People also ask

Is Microsoft discontinuing UWP?

Microsoft continues to baby-step around the obvious, but it has officially deprecated the Universal Windows Platform (UWP) as it pushes the desktop-focused Windows App SDK (formerly called Project Reunion) and WinUI 3 as the future of Windows application development.

What is replacing UWP?

We will replace UWP with WinUI components in our v22. 1 release. UWP controls and demos will be removed from all distributions/installations. We will continue to provide support and minor updates to our UWP controls until December 2022.

Does Windows 11 use UWP?

UWP is one choice for creating apps that run on Windows 10 and Windows 11 devices, and can be combined with other platforms. UWP apps can make use of Win32 APIs and . NET classes (see API Sets for UWP apps, Dlls for UWP apps, and . NET for UWP apps).


1 Answers

Naturally, the answer is "it depends". The first variable to consider is what type of app you are considering. If you are wanting to write a game, the choice is not immediately obvious. That's because there are logic apps that don't rely on an elaborate UI and immersive games that do.

Logic games

Because XAML and HTML are much simpler platforms to build simple UI, it makes most sense that you would choose from the following:

  1. XAML / .Net
  2. XAML / C++
  3. HTML / JavaScript

Choosing between these three is a matter of technology preference. But it is also worth noting that we now start with XAML and go to HTML when necessary. What I mean is, new Windows apps should consider XAML as their starting technology and choose others if they are necessary.

One reason you might choose HTML is if you have already created several HTML assets that you want to reuse. But, of course, you could also embed the XAML WebView control in a XAML app and use those HTML assets without requiring a full Web App. To that end, XAML remains the most viable choice.

Immersive Games

Because HTML and DirectX have considerable investments by third party companies and the community for games, it makes most sense to choose from the following:

  1. DirectX / .Net
  2. DirectX / C++
  3. Cordova / PhoneGap
  4. Hosted Web Apps
  5. Unity / MonoGame

It's worth reminding you that this article is about "greenfield" apps, but even so the above technologies are the technologies of choice for 99% of the games in the Windows Store.

The next category of apps are usually called productivity apps. And they have basically two sub categories: consumer and commercial. Consumer apps are public, while commercial apps are generally internal, line of business apps.

Consumer apps

Public apps have almost no technology requirements other than giving a full-fidelity, native experience to the user. For these apps, you choose the following:

  1. XAML / .Net
  2. XAML / C++
  3. HTML / JavaScript
  4. Cordova / PhoneGap
  5. Hosted Web Apps

The reason Cordova is included is because it is, basically, the HTML option with the added benefit of cross-platform. If cross-platform is a requirement, it's a great choice. I should point out that Xamarin can enable .Net apps to be cross-platform, too.

Sometimes cross-platform is not at the top of the list. Sometimes, it's really a greenfield Windows app. And when you are in that typical starting place, you need to start with XAML / .Net. Why? There are several reasons.

First, XAML is becoming the premium UI platform for Windows. many new aspects of the Windows 10 operating system are written in XAML (like Start, File Explorer, etc.) In addition, Office is now a XAML app, too.

Second, the bulk of samples and community support are in XAML / .Net. This means that regardless of your team's primary technical expertise, ongoing support should be incrementally easier thanks to XAML's popularity.

Third, .Net (like C#) is one of the most logical, powerful and simple programming languages you can choose. It easily supports projects from small to gargantuan. Plus, with .Net Native, .Net languages compile to the metal and perform at near-C++ levels on Windows 10.

Commercial / Line of Business

Commercial apps are a big deal and require some serious investment. Why? Because they are intended to run businesses. They need to be tested, scalable and performant. They need to be integrated and agile. All of these are sometimes part of consumer apps, but because a business can live or die based on their infrastructure, LOB apps are a more serious investment.

For commercial apps, choose XAML / C#.

Here's the reason why.

Since you are writing a Windows 10 app in the first place, I can assume your business is either Microsoft-based or Microsoft-friendly. This means your development team is likely already versed in the basic skills necessary to deliver an excellent XAML / .Net app.

In addition, as third party controls are released by our component vendors like Infragistics, you are going to see the enterprise-oriented controls written in XAML? Why? Because many of these controls have already been released for WPF and will be ported for WinRT as demand increases.

In addition, Visual Studio manages, builds, test, and analyzes .Net projects in a comprehensive and proven way. You are writing with the Microsoft UI platform and automating it with the Microsoft development platform. most companies like to have as few moving parts as possible and this is as pure as it gets.

In addition, many companies have already made significant investments in their LOB systems and have many valuable investments to reuse in their Windows app. Is the Windows app replacing their LOB? Probably not. Is it supplementing or complimenting an existing system? More than likely, yes.

Conclusion

So when should you use C++? Let me share a secret with you. Almost all of the first-party Microsoft MSN apps that ship in-box with Windows 10 are written as XAML / C++. This is because cross-device performance is critical for our apps. Does it mean your apps should be written in C++? In most cases, no.

What if my team is a web team and we have no XAML or .Net experience? First of all, that's unlikely. But let's go with it. We're developers, dang it. Technology does not care us. And, though languages vary, they are conceptually the same. Learning high-end techs like XAML and .Net are worth the investment when you look further down the calendar in terms of performance and impact.

The reality is, some people may disagree. And whatever anyone else says is likely right in some ways. This fundamental answer here is, generally speaking, how we are providing guidance to greenfield developers starting with new Windows 10 apps targeting the Universal Windows Platform. This isn't a commandment, just guidance.

If you are looking to learn more about Windows 10 app development using XAML and C#, take a look at this free, three day course on Microsoft Virtual Academy. https://channel9.msdn.com/Series/A-Developers-Guide-to-Windows-10

Finally, here are some features you should not forget:

  1. Size adaptability across screens
  2. Feature adaptability across devices
  3. Analytics with Application Insights
  4. Logging with the .Net Logging API
  5. Testing & automated builds on TFS/VSO
  6. Localizations into other languages
  7. Support for automation/accessibility features
  8. Use the Store to deploy, upgrade, and license

Best of luck!

like image 131
Jerry Nixon Avatar answered Sep 19 '22 03:09

Jerry Nixon