Respect the Browser - Lessons from JSConf 2009

“This is the real Future of Web Apps conference,” I thought to myself during the first day of JSConf 2009, the first Javascript-focused conference. Upon further reflection of the weekend, I realize that my idea of what a web application can be, and more importantly, how it should be created, has been fundamentally altered. The web browser, usually thought of as a dumb, thin client, is actually full of unrealized potential. It’s time that we, as web developers, tap that well and create a tidal wave of innovation. (This idea was championed by conference organizer Chris Williams in an impromptu lighting talk during the conference.)

In short, we should treat the web browser as a first-class development platform, and Javascript as a Serious Language™. No longer just for presentation, a browser can process business logic, and it can talk directly to our data stores. In offline mode, it can talk to its own data store and sync up later. A well-written application for the browser can give our users a markedly better, smoother experience. For developers, browser-centric development can help us deliver better applications faster, continuing on the promise of agile web frameworks like Django and Rails.

JSConf opened my eyes to the work already under way to accomplishing those goals.

The Frameworks

The two “killer” frameworks out there today are SproutCore and Cappuccino. Both aim to give users a Mac OS X-like experience on the Web. SproutCore is what powers Apple’s MobileMe and OtherInbox, while Cappuccino powers the Apply Keynote-like 280 Slides.

Francisco Tolmasky of 280 North kicked off the conference with an overview of Cappuccino and Objective-J (an Objective-C-like superset of Javascript) and a drawdropping demo of the nib2cib utility, which allows a Mac developer to use XCode’s Interface Builder to construct Cappuccino interfaces. Overall, it appears that Cappuccino is targeted at Cocoa developers.

SproutCore, on the other hand, is a Ruby gem, uses ERB for templating, and supports Rubyish concepts like Mixins. Mike Subelsky, co-founder of OtherInbox and upcoming speaker at RailsConf, presented on SproutCore on day 2. He stressed the importance of Key-Value Coding and Key-Value Observing in his talk, concepts which I admit I don’t yet fully grasp. Interestingly, it looks like SproutCore is in the early stages of iPhone support.

Speaking of the iPhone, a mobile framework called PhoneGap was presented as well. Currently targeting iPhone, Android, and Blackberry (with Palm Pre, Windows Mobile, and Nokia on the way), PhoneGap lets you write your web app (in HTML+Javascript) once, and have it available for all supported platforms (along with proper skinning for the target platform). PhoneGap also comes built in with offline storage support, and does other nice things for you like geolocation and harnessing the accelerometer.

One final framework worth mentioning is Titanium. This is the easiest to explain: it’s Adobe Air or Microsoft Silverlight, but using HTML/CSS and Javascript instead of proprietary languages. A Tweetie-like app was demoed by Appcelerator CEO Jeff Haynie, and it was certainly impressive.

Something that wasn’t presented, but I was given a demo of by a Mozilla employee, is Bespin, which is a web-based code editor harnessing the CANVAS tag in HTML5.

Dealing with Data and Processes

One of the negatives associated with Javascript has been a lack of options when it comes to data persistence. In recent years, we’ve seen support for Gears and HTML5’s WebStorage implemented in the browser, and these suffice for most use cases. There’s also been talk of CouchDB in the browser.

Gears also supports the notion of a worker pool, and Firefox will soon have Web WWorkers, both of which allow arbitrary Javascript to be executed in the background. For real-time messaging, Jack Moffitt presented on Strophe.js, a library for writing XMPP clients, which improves on the Comet concept that popped up a few years ago.

Browsers Almost There

With the pending releases of Safari 4, Firefox 3.1, and Google Chrome 2, there’s an arms race among browser camps to see who can come up with the best and fastest Javascript engine while building in the most comprehensive support for HTML5. That’s definitely a Good Thing. Who wouldn’t want to write code for a development platform simultaneously supported by Apple, Mozilla, and Google?

So, what about Internet Explorer? The latest version (IE8) does support some, but not all, of HTML5, and Gears is available for storage and threading. But I think this is an issue where we developers need to draw a line in the sand and send a clear message: Either Microsoft catches up with the others, or it gets left behind. If we treat Internet Explorer as a dying platform, it will become one. I’m talking about all versions of IE, not just the oft-maligned IE6.

There’s More

For a more comprehensive blow-by-blow, see Michael Harrison’s recap. Conference organizer Chris Williams penned a recap as well.

blog comments powered by Disqus