Custom Software Apps & SharePoint Consulting

Oh JavaScript, I’m sorry I doubted you.

In this series, Entrance’s Metro application intern gives his perspective on getting his feet wet with JavaScript + HTML5!

It’s not hard to find programmers poking fun at JavaScript. It seems to have always been a language that was stuck on the web, and even there it had some stiff competition. My first acts of programming took place on the web, and yet I never quite touched JavaScript, or even found myself regretting that I hadn’t. As a result, I developed some distaste for JavaScript. After all, none of the web designers I spoke with – some of whom were pretty talented – ever spoke of the language in a good light.

When I first saw that Microsoft offers JavaScript, in combination with HTML5 and CSS, as an alternative language for programming Windows 8 Metro apps, I laughed.

When I first learned I would have to program a Metro app in JavaScript, I cringed.

I was given the task with good reason: programming in JavaScript and HTML would offer the most flexibility as far as a web implementation of the app would go. So I began to look up JavaScript and HTML5 Metro app references, and began to play with some code. I noticed that Microsoft seemed to provide a bit more documentation for JavaScript than for the other language options; I was still skeptical, but I went on playing with that code. The results were surprising.

I won’t lie: there seem to be some stability issues with JavaScript that weren’t present in my C#/XAML implementations of similar apps. It may be an issue with the language, or it may be an issue with the virtual machine I’m using to run Windows 8 (hey, it may be an issue with Windows 8 itself right now). It doesn’t really matter. When the JavaScript version of the app does get past those few hiccups, it is absolutely beautiful. Microsoft seems to really want Metro apps to pull information straight from the internet with little to no parsing involved, and JavaScript/HTML5 handles that information like a dream. Where C#/XAML is forced to render web content in an ugly bordered box (with no styling options and difficulty accepting input to the page), JavaScript/HTML5 can render a seamlessly integrated, beautiful rendition of the page you requested access to. JavaScript truly does justice to the Metro design philosophy, giving the developer true control over content pulled from the web.

The improved documentation definitely counts, too. In about an hour, maybe two, I was able to go from basically no JavaScript experience to fluidly integrating an interactive map into a Metro app. It would have taken less time, if not for the few hiccups I talked about earlier. I did this with the help of an eBook preview on the subject (provided for free by Microsoft (sent to me by Nate (thanks Nate))) and a few looks at the Bing Maps API documentation. I don’t think it could have been easier. It certainly couldn’t have looked much better: even though I was pulling a complicated web control like a map straight from the internet, it still fit seamlessly into the design I put together using pretty basic HTML and CSS.

I’m getting the impression that Microsoft is going to strongly push JavaScript/HTML5 as its language of choice for Metro app development. I could be totally wrong; C# is designed by Microsoft, and might take the forefront at some point in the future. However, given the current amount of documentation and the ease with which the language fits into the Metro philosophy, I think JavaScript might be the best language to work with at the moment.

This could be a big break for JavaScript, in the end, if it can go from a web-only scripting language to the backbone of the next Windows system’s apps. Maybe they’ll even fix a few of the language’s flaws as a result.

Share this post with your friends

Share on facebook
Share on reddit
Share on twitter
Share on linkedin
Skip to content