Channels ▼
RSS

Tools

Win 8 Development: The Lessons Learned


I started my Windows 8 programmer career in September 2010, when I moved into my new office at Microsoft, down the hall from the Visual Studio 2012 team and the Windows Library for JavaScript team (WinJS). Having now written programs for two years on an operating system that's been generally available for only four months means that I'm often asked how programmers should approach this new platform.

More Insights

White Papers

More >>

Reports

More >>

Webcasts

More >>

To start, I'm going to point you to the tools and resources you'll find at Windows Dev Center. After that, I recommend the videos from Microsoft's last BUILD conference. Beyond the basics, I can also give you some advice that might not be immediately obvious to you from reading the docs. That's what the rest of this article is about.

Know Your Options

Before anything else, you should understand your options. To build first-class Win8 apps, you can use .NET and XAML with C# or Visual Basic. You can also write apps with HTML and JavaScript, along with the rest of the Web platform, (CSS, Canvas, SVG, and the like). And you can write native apps using C++ and either XAML or DirectX.

However, if you use .NET or JavaScript, remember that you're bringing in the overhead of the accompanying runtime (the .NET runtime or the Web platform), whereas if you use C++, not only do you have native access without that runtime, you also have access to parts of the Windows API that aren't projected into the Windows Runtime (the latter being the set of object APIs that are shared between JavaScript, C#, Visual Basic, and C++). If you need access to these other APIs or Direct3D or if you're looking for the best performance, then you'll definitely want to go native.

If you do go native, remember that Windows 8 is no longer exclusively x86 — you'll need native binaries for both x86 and ARM if you want to cover the full range of available Win8 devices. On the other hand, .NET and JavaScript apps run just fine across x86 and ARM. If you're not building an app that needs the performance of a twitch game, but rather a front-end to an Internet data source, a media player, or even a casual game, you'll find the hardware-accelerated performance of XAML or HTML to be excellent, not to mention the huge amount of existing code provided by the community. You'll also enjoy the higher productivity that a managed environment provides C#, VB, and JavaScript programmers.

In fact, both HTML and XAML have been optimized so thoroughly that you won't be able to tell the difference between an app written with XAML and .NET from one written in HTML and JavaScript. So which managed environment do you choose? The one you're the most comfortable with. Do you have a lot of experience with .NET and some libraries to bring forward to a new Win8-style app? Use .NET. Do you have a bunch of Web developers who like jQuery plug-ins and CSS? Use JavaScript. Follow your preference — both choices are extremely capable.

Architecture of the App

Picking a technology is only one piece of the technical puzzle, however. You also need to be careful about how you structure your app. As an industry, we've moved from client-only to client-server to n-tier to our current favorite: hub-and-spoke. The hub-and-spoke architecture provides the basic structure for most modern mobile apps: At the hub, you've got your server, which provides data and logic synchronized between multiple client spokes, such as Windows Phone, Win8, Web, iOS, Android, etc.

Each spoke is designed and optimized for the specific host OS and the hub is the authoritative holder of the data shared between all clients. This kind of architecture calls for several considerations, including communication channel decisions (pull over HTTP, push over SMS, etc.), offline caching support, per-client data projection and filtering, and so on. As each spoke is added, you'll find that the hub often needs to change to support the particulars, so you'll need to think about the user experience you want and make those hub design decisions accordingly.

Specifically, when it comes to Windows 8, you'll want to tailor a hub-and-spoke client for things you've undoubtedly already heard about: a touch-centric UX, Win8 UI style, fast and fluid animations, and so forth. What you might not have heard about is the three primary rules for a high-quality Win8 app: integrate, integrate, integrate! In prior versions of Windows, we had the Clipboard, which allowed each app to share whatever data it wanted in whatever formats it used. In Windows 8, there is still a Clipboard, of course, but it is only one of many "contracts" for sharing data between apps.

For example, the SkyDrive app not only allows you to browse the files in your SkyDrive account, but it's also a File and Folder "provider," so when you want to open a file from a Win8 app, the file and folder dialogs know to let you choose something in SkyDrive as well as on your local computer. The app that's requesting the file doesn't need to know or care that the file is coming from SkyDrive — the operating system takes care of that, in the same way it maintains the Clipboard. Other contracts include Search, Settings, Share, and Contact Picker, just to name a few.

In addition to the contracts, which allow you to integrate your app with other installed apps, the Win8 Start Screen also enables a great deal of integration with Live Tiles, Badges, Notifications, and the Lock Screen. Live Tiles are especially important, as they represent a key differentiator of the "Metro style" UI shared between Windows Phone, Windows 8, and the XBOX.

Differentiate

And speaking of differentiators, another key thing you should do in your app is just that: differentiate. When you read the guidelines that describe Win8 UI style, you'll hear a great deal about the Windows 8 way of arranging data, using the contracts, providing the right animations, consuming the right gestures, using the right fonts, and so on. However, once you've gotten your head around the Win8 UI style, you'll need to bend or even break some of the rules so that your app stands out from the crowd. Your app must have personality as well as functionality, if it's going to be featured as a top app in the Store and get you the reputation and revenue it deserves.

With Windows 8 and the Windows Store, we're at the beginning of a new era of Windows, which brings devices, touch, and UX design to the foregroud — while keeping desktop apps running well, too. The future is going to bring great changes as we learn how to design apps for this new world. Stick around. We're just getting started!


Chris Sells is the VP of the Developer Tools Division at Telerik. He's written several books, including Building Windows 8 Apps in JavaScript, Programming WPF, Windows Forms 2.0 Programming, and ATL Internals. In his free time, Chris makes a pest of himself on Microsoft forums and mailing lists.


Related Reading






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.
 

Video