The Windows 10 developer’s dilemma: Go Universal or stick with the desktop?

Microsoft’s Universal Windows Platform offers code-once-run-anywhere upside, but development drawbacks abound

The Windows 10 developer’s dilemma: Go Universal or stick with the desktop?
iStockphoto

Microsoft’s newly released Windows 10 offers developers what at first blush appears to be a can’t-miss pitch: Write your app once and run it anywhere Windows exists. With Microsoft’s push toward “one Windows” across multiple device types, ranging from the plain old desktops to augmented reality headsets, the appeal of that pitch could be massive, not to mention lucrative, for developers.

But while Windows chief Terry Myerson promises that the latest incarnation of Windows will “inspire new scenarios across the broadest range of devices, from big screens to small screens to no screens at all,” the reality is that the new Windows gives developers difficult choices, and coding successfully for multidevice Windows is complex and involves compromises. And anyone who remembers Silverlight knows that Microsoft’s visions of developer nirvana should be considered carefully before making a full commitment.

Here, we take a closer look at Microsoft’s latest direction for Windows app developers and whether it’s worth ditching the tried-and-true desktop app approach for a more universal option.

Microsoft’s Universal aspirations

Microsoft’s release of Windows 8 in late 2012 was intended to be a watershed moment for personal computing. Convergence, hybridity, and tablets were all the rage, and Microsoft aimed to regain relevancy in the mobile market by introducing a new platform within a platform, called Windows Runtime, aka Metro. The idea was to create a tablet-friendly interface alongside desktop Windows that would offer users easy installation and removal of applications via Microsoft’s answer to Apple’s widely popular App Store, the Windows Store.

Unfortunately, Windows 8 confused users with its “Frankenstein” approach of presenting separate environments for Metro and desktop applications. As a result, most users tended to stay within the more familiar desktop environment, avoiding the new-style Store apps altogether. With little in the way of a market to entice them, developers also largely ignored Microsoft’s Metro aspirations, rendering the Store moribund compared to its Apple or Android counterparts.

Windows 10 marks a reboot of sorts, with Microsoft restoring the desktop as the single environment for applications and featuring a reworked Start menu that no longer fills the entire screen. The move sees Microsoft renewing its efforts to promote Store apps. This time the market may have more appeal, from a developer’s perspective, as the latest evolution of Windows Runtime is coming to phones as well as PCs, along with the Xbox One gaming console and other platforms, including HoloLens augmented reality headsets and Raspberry Pi boards for Internet of things projects. This is what Microsoft is now calling the Universal Windows Platform (UWP).

The terminology is confusing. Microsoft introduced Universal Apps for Windows 8, meaning you can share code between Windows 8, Windows Phone, and potentially other platforms. The UWP is different, letting you run the same compiled code on different device types. You can think of a UWP app as a type of Store app designed to work on multiple devices. Code one app package and run it anywhere Windows 10’s core does.

An enticing proposition, but should you buy into Microsoft’s approach?

Microsoft’s vision: One store to rule them all

To understand why Microsoft is attempting to herd developers toward UWP and away from creating desktop applications, look no further than the Windows Store. Microsoft remains wedded to the Store app model because it is essential if Windows is to escape becoming merely a legacy platform for business applications. From a developer’s perspective, Store apps offer significant benefits:

Manageability. Windows desktop applications are normally deployed with setup and Windows Installer routines that can place files in a variety of places and make system changes such as installing and registering libraries that can impact other applications. Store apps are deployed using packages with an APPX extension, which are signed Zip files containing the application files and an XML manifest. Apps are isolated from one another and from the operating system, and both installation and removal is handled by Windows. Consumers benefit from easy app discovery, installation, and removal. Businesses will also be able to create a private section within the Windows Store, as well as using a Web-based Store portal, to deploy applications to specified users, signing in with Azure Active Directory (the directory underlying Office 365). Applications can also be deployed via System Center, the cloud-based InTune, or other mobile device management (MDM) systems.

Security. Application isolation and the requirement that all apps are signed makes a Store app safer for users than a desktop application. Apps are also vetted before acceptance into the Store. Application isolation is not absolute, particularly for businesses that can use SQL Server client libraries, which are not normally available, as well as a feature called Brokered Runtime Components to bypass the sandbox. Even so, if Windows ever reaches the point where most users install only UWP apps, the operating system would be more secure as a result.

Touch and mobile support. UI frameworks for the UWP are touch-friendly by default. The controls are chunky, and there is support for gesture interactions such as press and hold, swiping, and pinch and stretch for zoom. In principle, a UWP app should be designed to work on tablets and in some cases phones, as well as on PCs with keyboard and mouse.

Discoverability. Apps in the Store are searchable by users. In Windows 10, Microsoft includes the Store in search results delivered by Cortana (Microsoft’s digital personal assistant) or Windows Search, now placed prominently on the taskbar. Another benefit is that users can purchase an app once and install it on multiple devices. The device limit is 10 per account (though developers can enforce a lower limit if they choose) across all UWP device types.

Universal Windows Platform: The case against

The advantages of the UWP are real, but there are drawbacks. Desktop applications, for one, run on any version of Windows, even back to Windows XP in some cases, whereas UWP apps run only on Windows 10. True, Microsoft is offering free upgrades to Windows 10 for most Windows 7 users, but not all will follow Microsoft’s lead; moreover, some PCs will be blocked because of driver issues. Businesses that have standardized on Windows 7 will not migrate quickly to Windows 10, and the free upgrade does not apply to the Enterprise edition.

A key feature of UWP apps is support for Windows Mobile, but Microsoft’s commitment to its phone platform seems to be wavering, following CEO Satya Nadella’s announcement of a reduction in jobs in this department, the write-down of assets acquired from Nokia, and the departure of former Nokia CEO Stephen Elop.

The capabilities and behavior of UWP apps differ from those of desktop apps, a point that is disguised in Windows 10 where they run in resizable windows. App isolation is good for security and manageability, but it can present problems for developers, and only a subset of the Windows API is normally available. The missing parts are in general those that would break isolation.

Another key difference is the application lifecycle. Desktop applications have essentially two states, running or not running. Store and UWP apps also have a suspended state, which is activated shortly after the user switches away from the app, or if the PC goes into low-power mode. Shortly before suspension, Windows fires an event that tells the app to save its data and state and to release any open resources, such as file handles. The event handler must not take more than 5 seconds to run (10 seconds on a phone), or Windows will assume the app has crashed.

Saving state is important because Windows may terminate a suspended app at any time -- for example, if memory is running low. When the user switches back to a suspended app, a resume event fires enabling the app to restore its state, so it appears to the user as if the app had remained running. Presuming developers respect these guidelines, the process of saving and resuming state can result in less smooth app switching than with desktop applications.

Windows calculator comparison

The old and new Windows calculator illustrates how UWP apps can seem unnecessarily large for desktop users.

The touch-friendly user interface of UWP apps can also be a disadvantage, in cases where most users will have mouse and keyboard. If you compare the Windows 10 calculator app with the old desktop Calc app, for example, you can see that new version is larger with bigger, bolder numbers; some users have complained that it is unnecessarily chunky. In general, developers have struggled to achieve the same level of information density in Windows Runtime apps versus desktop applications. Smart design can overcome these issues, and Microsoft’s new Mobile Office apps are an example of combining a feature-rich user interface with touch-friendly design.

The fact that Windows 10 is desktop-centric means that developers can continue to code Win32 (or Win64) native applications without looking out of place. It is also possible to call many Windows Runtime APIs from desktop applications, enabling support for features like Windows 10 notifications.

Microsoft is also developing a project to allow Win32 desktop apps to be deployed from the Windows Store. Called Project Centennial, this draws on Microsoft’s existing App-V technology to create a virtual container that gives these apps some (but not all) of the isolation benefits of UWP apps as well as the same installation and removal experience. Project Centennial is a work in progress; the company showed a preview at Build in April, but no date has been announced for its availability.

When Windows 8 was released, Microsoft’s desktop application frameworks seemed near-frozen, with all the company’s energy going into the Windows Runtime. This is not quite the case with Windows 10. In particular, the Windows Presentation Foundation (WPF), which is the natural choice for .Net developers creating desktop applications, has been upgraded with improved touch input support and transparent child windows. The design tools have also been reworked. The Blend visual designer has improved version control, IntelliSense code completion in the editor for XAML (the presentation language used by both WPF and the UWP), and basic debugging. There are also new WPF diagnostic tools in Visual Studio. Even the venerable Windows Forms framework has been slightly updated, with High DPI support extended to include more controls.

Visual Studio 2015 and Blend

Working on a Universal Windows App with Visual Studio 2015 and Blend

The news is mixed for those coding desktop applications in C++ with MFC (Microsoft Foundation Classes) or other Win32/Win64 frameworks. The good news: Application compatibility on the desktop side is good. The bad news: Nothing has been done to improve MFC. There are new COM interfaces for C++ developers enabling access to Windows 10 features such as notifications.

Overall there is still a good case for building desktop applications in the Windows 10 era, perhaps more so than with Windows 8. But UWP apps have advantages too, giving developers of new applications a dilemma: Do they buy into Microsoft’s “One Windows” idea and build for the UWP; or stick with desktop apps for wider compatibility and fewer restrictions, but without the UWP benefits in mobile support, security, deployment, and discoverability.

Developing for Universal Windows

Developers who decide to develop for the UWP or who have existing Windows 8 Store apps to migrate will find a substantially improved platform. One key difference in Windows 10 versus Win8 is the effort Microsoft has made with its own apps, including built-in apps such as Mail, Calendar, Photos and Groove, and Office Mobile with its impressive tablet-oriented versions of Word, Excel, PowerPoint, and OneNote. Office Mobile is apparently developed in C++ and XAML, and having internal developers create large and complex applications on the Windows Runtime will help to focus Microsoft on improving the performance of the platform.

Micrsoft Word for Mobile

Word Mobile is one of several high-quality UWP apps from Microsoft itself, showing the potential of the platform.

As with Windows 8, language options for UWP apps include C++ with XAML or DirectX; C# or Visual Basic with XAML; and JavaScript and HTML using Microsoft’s WinJS framework.

Apps using .Net languages launch more quickly in Windows 10, partly thanks to Microsoft’s work on .Net Native, which compiles C# and Visual Basic apps to native code, including static compilation of a refactored .Net runtime. Microsoft claims that apps start up to 60 percent faster and use 15 to 20 percent less memory.

There are also extensive changes to the XAML framework used by the UWP. Many of the changes support what Microsoft calls the Adaptive UI, enabling applications to transform their user interface according to the current display size.

1 2 Page 1
Page 1 of 2
Bing’s AI chatbot came to work for me. I had to fire it.
Shop Tech Products at Amazon