Developer Recommendations from BUILD
Joe Kunk sifts through the Windows 8 announcements at BUILD and offers advice on next steps.
After much secrecy, Microsoft unveiled Windows 8 at the Build conference in Anaheim CA in mid-September 2011. The Developer's Preview is available for download here.
The preview is surprisingly stable; this article was written in Windows 8 using SkyDrive.
Also detailed were features of the upcoming update to Visual Studio, referred to as V.Next. While not expected to be included in V.Next, Anders Hejlsberg demonstrated Roslyn, the compiler as a service project for Visual Studio, an exciting technology that will enable many new capabilities for developers.
By this time many developers have had a chance to review the keynote recordings, the session recordings, and try out a few of the hands-on labs. So what does all this information mean for C# and Visual Basic developers? What do we need to do to prepare for the release of Windows 8?
.NET Framework Upgrades
Windows 8 will have two modes to help satisfy the needs of Windows users across a wide range of hardware form factors.
The desktop mode allows .Net developers to continue to develop and run applications just as they currently do in Windows 7 and Visual Studio 2010 (or earlier versions). The new .NET Framework version 4.5 provides enhancements to the Common Language Runtime (CLR), Web, networking, Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF), and Windows Workflow Foundation (WF). Microsoft has clearly made a commitment to continue to evolve and enhance the advanced Windows application functionality that many organizations and .NET developers have enjoyed during the 10 years since the release of the first .NET Framework.
The Metro-style interface provides a Windows Phone 7-style experience under Windows 8. Many of the enhancements were developed to bring mobile capabilities natively into Windows so that Metro can be available on every device running Windows, including those based on low-power ARM processors. The new Windows Runtime (WinRT), which provides system services to Metro, interacts directly with the kernel and doesn't depend on Win32, making Metro-only devices possible.
The goal of Metro mode is clear: Provide a high-quality Windows user experience on all hardware form factors such as smartphones, tablets and desktops, taking full advantage of the hardware features available including GPS, accelerometers, touch and so on. Applications are certified by Microsoft to be safe and meet certain standards before becoming available in the Windows Store.
In Metro development, user experience quality trumps developer convenience. In WinRT, any method that can reasonably be expected to take longer than 0.05 seconds (50 milliseconds) has been written as an asynchronous method in order to keep the display responsive, even though developers often prefer the easier synchronous method calls. Metro applications will run in a sandbox, limiting access to system devices and resources to prevent potentially harmful actions.
There were some concerns voiced in the developer community about the future of Silverlight under Windows 8. Silverlight continues to work fine under Windows 8 desktop mode, but all plugins are prohibited from the Metro version of IE 10, including Silverlight and Flash. This will help improve battery life, security, reliability and privacy.
Windows Phone 7 Silverlight applications can't be directly ported to Windows 8 Metro, but because of the support for managed code and XAML, the conversion shouldn't be too daunting. Developers wishing to deliver Silverlight-like applications to Metro-only devices will need to make them available via the Windows Store and coded with XAML, driven by C# or VB.
My recommendations for both C# and VB developers:
- Continue to use the full power of .NET for desktop applications where appropriate; there is and will continue to be a strong demand for full-featured desktop and ASP.Net applications.
- If you aren't comfortable with XAML yet, this is a great time to learn it.
- If your application needs to run managed code on the Mac OS, Silverlight is still an excellent choice.
- Get comfortable using asynchronous methods. The new Async and Await keywords will help make coding these methods almost as easy as synchronous methods in many cases. These new asynchronous keywords are not solely for Metro applications; Windows Forms applications can now easily utilize asynchronous methods, too.
- The standards-based OData protocol within an SSL-enabled Web site is a great way to provide data operations without a browser plugin. This article provides a good introduction to OData.
Windows 8 promises to provide a platform to run a single application across hundreds of millions of devices from smartphones to tablets, all the way up through the most powerful desktop. It's an exciting time to be a .Net developer.
Joe Kunk is a Microsoft MVP in Visual Basic, three-time president of the Greater Lansing User Group for .NET, and developer for Dart Container Corporation of Mason, Michigan. He's been developing software for over 30 years and has worked in the education, government, financial and manufacturing industries. Kunk's co-authored the book "Professional DevExpress ASP.NET Controls" (Wrox Programmer to Programmer, 2009). He can be reached via email at [email protected].