Monday, October 10, 2011

Windows 8 Metro apps in JavaScript

I’m having a blast exploring Windows 8 Metro app development and poking around in the preview bits shipped at the 2011 BUILD conference.  Last weekend, I presented on Metro app development using JavaScript at the Silicon Valley Code Camp.

I’ve posted the sample code, my presentation script, and my slide deck on the IdeaBlade wiki.

I have not gone crazy and transferred my affections from .NET to JavaScript. I’m just curious about all the hub-bub. It’s also the only fair way to confront the assertions that JavaScript has grown up and that we’ll all soon be JavaScript programmers.

What is all this noise about “programming in standards-based HTML5 and JavaScript” … which is technically possible in Windows 8 … although in practice you’ll be so imbricated in Windows that you might as well have written it in COM.

I exaggerate … slightly. I’m not being critical though. You want to program for the iPad? You’ll use Objective C. For the Android? You’ll write in Java. At least for a Windows 8 device you can write your app in Javascript … or C++ … or C#/VB. The languages are (mostly) open; the application code is locked in.

I had tons of fun following along with Chris Tavares and Chris Sells as they built a Metro RSS Reader in JavaScript. The resulting demo app looks like this:

WinJsDemo-Part 5

I stole borrowed almost everything I showed from Chris’ talk … unless I pinched it from Luke Hoban’s talk.

It’s always a kick to take a new technology out for a spin. The Microsoft folks are doing wonders with JavaScript on Windows but it’s still a dog walking on hind legs and always will be. I get … and approve of … what they’re doing: embracing the fresh faces coming out of school who “know” (be very wary of that verb!) HTML and JavaScript … not C#. That’s smart business.

I expect to keep playing with JavaScript and writing about my experiences. I’m sure that it’s the perfect tool for many jobs. HTML and JavaScript (of a more general variety) may turn out to be the universal solvent for cross-vendor mobility apps.

But not now and not soon. When it’s time to get serious about writing business applications, I’m sticking with the XAML technologies, Silverlight especially. Far more productive, less painful, and less risky in the hands of muggles … which is to say, most of us.