A friend of mine is working on a complicated publishing app; the data is XML, perfectly appropriate when your objects are documents. She told me they were thinking about automating some of the work by running XSLT transformations out there in the client with libxslt. I said “Well yeah, as long as the client’s a PC not a tablet”. The category of “things you can do on a PC but not a tablet” is interesting.
I dropped AJAX into that narrative for a reason. The ”X“ stood for XML, which these days feels kind of heavyweight for use in Web apps, unless you’re working with real actual documents. But when AJAX was a bright shiny new idea, we didn’t care, because we had near-infinite power at our disposal.
At the center of our world was a poor overtaxed Web server trying to take care of a kazillion users’ requests. It was usually running in maxed-out mode, while the computers it was serving were, in aggregate, infinitely powerful, had hundreds of meg of lightly-used memory, and typically ran with idle times averaging over 90%.
So all those other architectural advantages aside, the computer-resource macroeconomics weren’t subtle; any piece of work you could offload from server to client was a win.
It might still be. But there are clients and clients and clients. Like I said at the top, you can’t run an XSLT transform on a phone.
In fact, there are lots of things you can’t do on a phone. I’m privileged to work in close contact with platform engineers, and I’ve learned how close mobile frameworks live to the edge of the possible. There’s no spare memory and, since there’s no spare battery, there’s no spare CPU either. I’m not just talking about Android, either.
This sort of sucks. There was a time when every client was a browser running on a PC, and most PCs were in the big picture like most other PCs, and that’s how the world was. But now, we’re in a position where client memory is very nearly as scarce and precious as server memory. Which changes lots of things.
I’m not sure how this plays out. Right now, on Android or iOS, you can get more out of that candybar in your pocket with a native app than with Web code. But who knows how long that will last? We’ve got Chrome on Android now, and some of the phones they’re rolling out at MWC 2012 in Barcelona constitute pretty big iron. On the other hand, you’d maybe like your app to be available on a minimal developing-world phone too.
The one thing in the big picture that I don’t see changing any time soon is the basic JSON-over-HTTP architecture of more or less every interesting business app. That at least insulates the moving target running on the server (NodeJS? Go?) from the moving target running on the client (Dart? B2G?), and that has to be a good thing.