After more or less ignoring the whole “WinRT” thing (except for making an experimental WinRT port of NAudio), since Windows 10 came out I have been getting to grips with the new UWP platform. I’ve been particularly focusing on the audio side of things, and I’ve got a Pluralsight course in the pipeline which I hope to share more about very soon.
But the question I want to ask is, why would anyone want to create a UWP application? What’s the point? So I’ll start with a few of the reasons why you might avoid creating UWP applications, and then try to make a positive case for when it would make sense.
Reasons to avoid UWP
1. It’s Windows 10 Only. Although Windows 10 has picked up a decent amount of market share in its first year, there’s no question that Windows 7 remains the most popular version of Windows out there. And there are plenty stuck on other versions from XP through to 8.1. UWP applications require Windows 10 and above, so the question is, can you afford to target only a small segment of the market, even if it is steadily growing?
2. Desktop Apps are Dead. Well, according to some people anyway. The truth is, much more can be done in the browser than ever before, and we are even seeing the rise of hybrid desktop/web technologies such as electron that are blurring the boundaries. However, I still think there are a category of applications that fit better as a “native” desktop application, particularly when integration with the operating system and devices is important.
3. It’s Yet Another New Thing to Learn. The pace of change in this industry just seems to be getting faster and faster, and UWP brings a whole new set of APIs requiring us to relearn things like how to interact with the file system. Now it turns out actually not to be too hard if you already knew WPF (more on that later), but for those not already using XAML, there’s quite a lot of new concepts you’re going to have to get familiar with.
Reasons to use UWP
1. Target Multiple Device Families Probably the biggest selling point for UWP applications is that your application automatically runs on all the Windows 10 device family from regular desktop Windows, to Windows mobile, XBOX One, embedded IoT devices (even Raspberry Pi) and the HoloLens. Now of course your app might not make sense on all of these platforms, and it will likely need a bit of tweaking to fit the constraints and capabilities of each of those platforms, but Microsoft are to be commended for having finally created one API to rule them all.
2. Bring Your WPF Knowledge If you are already a WPF developer, then you will find the transition is actually pretty smooth. The XAML side of things will be completely familiar to you and it is just a few new APIs to learn.
3. It’s the Future of Windows If you don’t care about targeting multiple device families, you could argue that UWP is irrelevant – just build a regular win32 or .NET app and have it run across all versions of Windows back to Windows 7 and even earlier in some cases. But Microsoft are betting big on this new API, and if you want access to the latest and greatest features of Windows as they become available, whether that’s voice recognition or inking support, then UWP is the place you want to be. (Having said that I expect the old win32 APIs will die a very slow and lingering death over the next 20 years or so)
4. Sell Your App Through the Store It’s true that the Windows 10 store hasn’t really taken off yet. Many of us “old” hands are used to downloading our apps from random websites and installing them manually. But a new generation is growing up who are used to getting all their new apps through the store because that’s how it works on their phone and tablet. So being in the store will become increasingly important. It also matters because there is greater trust for apps available in the store, which brings me onto my final reason for using UWP.
5. It’s a Much More Secure Programming Model One of the first things that hits you about writing UWP apps is what a pain it is to read and write files, or access things like the microphone. You have to get the user’s explicit permission before you can do anything that could potentially compromise their private data. And that’s actually a good thing. As malware and ransomware become more prevalent, it may not be long before people start locking down their Windows PCs so that only apps from the store can be loaded (a similar situation to where we already are on phones).
So those are my five reasons to use UWP. Of course, the reasons not to may outweigh them for your app. I think the main candidates for UWP apps are rich client line of business applications (where the customer is running Windows 10), casual games (where there is benefit in targeting multiple device families), and applications that benefit from accessing operating system features.
What did I miss? Can you envisage yourself creating a UWP application, or will you be avoiding it? Let me know in the comments.