New directions in web architecture. Again. – O’Reilly Radar via Beyond The Beyond
Specifically: take a look at the new Twitter. It’s a nice web application, sure – but look at the HTML. There’s not much there. The HTML page you get from Twitter is largely a bunch of empty divs, with a big wad of JavaScript. What’s happening? The JavaScript is the entire application; the divs exist only to provide tags so the JavaScript can rewrite the DOM at will. In turn, the JavaScript is constantly (and asynchronously) making requests from the Twitter site, which is just returning data from its API. In fact, the Twitter site is returning the same data for its web page that it would return for its mobile app, for TweetDeck, or for any of the apps in the Twitter ecosystem.
This design isn’t particularly new; we’ve seen it ever since developers started reverse-engineering GMail and Google Maps to get ideas for their own projects. Those big Google apps may have been the first examples of this architectural trend. They were certainly among the first to use JavaScript as a full-fledge client programming language. But we’re seeing many more sites built along these lines. Why now, what does this shift mean, and why is it important?
“Why now” is perhaps the easiest question to answer. A few short years ago, web developers only had one platform to support, and that was the “browser.” Granted, there were a dozen or so browsers of significance, and the browser world was riddled with incompatibilities. We’re in a different world now. Browser compatibilities have been ironed out, to some extent (though conscientious developers still support “legacy” browsers, all the way back to IE6 or even IE5). But it’s no news that the most important new apps these days run on devices ranging from phones (iPhone, Android, BlackBerry, Windows Phone), tablets (iPad, Android/ChromeOS devices), and potentially ebook readers and other new devices. With these new devices on the table, browser incompatibilities pale in significance. It’s another sign of the times that I can’t conceive of an interesting application that doesn’t access data across the network.