Review: Visual Studio 2012 shines on Windows 8

Microsoft's everything-and-the-kitchen-sink IDE fuels Windows 8 and Windows RT development with smoothly integrated tools and an abundance of resources

Page 2 of 6

Building Windows Store apps
In such a broad panorama of editions, target platforms, and target applications, it is difficult to identify a sole, outstanding, key new component of Visual Studio 2012. However, it is safe to assert that -- given the proximity of the release of Visual Studio 2012 with the release of Windows 8 -- the new IDE's support of the new operating system is at the top of the list.

Windows 8 presents a new kind of application: the Windows Store application (sometimes just called a Windows 8 app). Originally referred to as a Metro Style application, a Windows Store app or Windows 8 app is a "whole screen" application that runs on Windows 8 or Windows RT. It is not composed of multiple, overlapping windows (which is a bit weird given that it's running on an OS called Windows). The user interface of a Windows 8 app is clearly optimized for finger or stylus input, but can employ mouse or keyboard. The display surface is partitioned into a grid of tessellated rectangular regions, and the fundamental onscreen object is a tile, rather than an icon. On the startup screen of Windows 8, of course, the applications themselves appear as tiles.

You construct a Windows Store app using several language combinations, typically a language pair. A pair of languages is needed because the application code consists of both front-end and back-end components. The front-end (display) component is defined using a declarative language like XAML or HTML5; the back end (execution logic) executes in a procedural (or object-oriented) language such as C# or C++.

The specific combinations supported by Visual Studio 2012 are JavaScript and HTML, and C#, VB.Net, or C++ and XAML. If you want to build a game for Windows 8 and RT, you can add C++ with DirectX to the list.

Visual Studio 2012 is your one and only shop for building Windows Store applications -- that is, whole-screen, touch-driven apps that will run on Windows 8 or Windows RT or both.

Auto-magical multithreading
In concert with the arrival of Windows 8, .Net is being updated to version 4.5. Here, Visual Studio 2012 supports the new "async code" constructs in C# and VB.Net, which require new syntax elements in the languages and define new behaviors. Using the async and await keywords, you can identify potentially long-running methods -- that is, methods that may be blocked waiting for an I/O response -- but permit other parts of your code to continue executing, unimpeded by the blocked methods. Asynchronicity is key in Windows 8 apps. The Windows 8 application model is geared toward responsiveness, and many of the Windows 8 runtime APIs only support asynchronous operations.

When you define an async method, you're specifying that the method's results will be available at some unknown time in the future. The calling code can continue to execute, until it reaches a point where it must use the async method's return value. You identify this point with the await keyword. An async method returns a Task object, which encapsulates the rendezvous point (used by await) and provides access to the method's return value. In essence, the async and await keywords provide multithreading without your having to write callback functions, or thread startup and teardown code.

Not only does Visual Studio 2012 recognize the new async keywords, the IDE's debugger is also async-aware. You can debug an application as though the otherwise asynchronous code executed synchronously.

The .Net async feature is similar to JavaScript's "promise" (also called "deferred") objects. As in the case of .Net async, a promise object encapsulates the results of an operation that, if called synchronously, would block execution. JavaScript promises are not syntactic elements (unlike the .Net async feature), but abstractions of behavior. The jQuery and Dojo JavaScript libraries provide implementations of promises, as does the Windows JavaScript library, WinJS, which is used when you build Windows 8 Apps with JavaScript and HTML5.

| 1 2 3 4 5 6 Page 2
From CIO: 8 Free Online Courses to Grow Your Tech Skills
View Comments
Join the discussion
Be the first to comment on this article. Our Commenting Policies