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
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++.
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.
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
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
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.