Writing Apps as Enriched Documents

By Simon St. Laurent
June 24, 2010 | Comments: 4

I've been surprising people more people than I expected lately with the revelation that it's possible to write iPhone and Android applications as a pile of HTML and CSS documents with some accompanying JavaScript. I'm far from the first to push this, of course. It was Apple's original development model for the iPhone, the core of WebOS, and central to Jonathan Stark's brilliant Building iPhone Applications with HTML, CSS, and JavaScript and his similar upcoming Android book.

Nonetheless, it seems that decades of training have taught people that "sites are made of documents and scripts, but apps are written with code and APIs". I'm feeling kind of bitten by this perspective with the release of SenchaTouch, an API-based app framework that does amazing things but discards the document-based approach of jQTouch, also created by David Kaneda Colby.

The folks at Ajaxian called Sencha Touch "The end of native", celebrating the power it captured in JavaScript. It's true that Sencha Touch is built on the web technologies I've celebrated in the past, and wow - it really is amazing to watch. At the same time, though, it's built around the code-centric model that I was happy to escape with jQTouch. It's certainly not Objective-C, but its approach to building an application isn't all that different. To put it in a light favoring API-based development, Sencha VP Products Michael Mullany told Ajaxian:

With respect to jQTouch vs. Sencha Touch, jQTouch is a good solution for people who need some progressive enhancement of web content, but it's not a full application framework.

That's really strange to me. The contrast I see is "progressive enhancement of web content" vs. "application framework", but somehow he qualifies the former with "some" and praises the latter with "full". My phrasing would be more like:

With respect to jQTouch vs. Sencha Touch, jQTouch is a good solution for people who need to turn content into a full-fledged app experience, while Sencha Touch is an application framework meant for people whose focus is primarily code-based interactions.

What's the difference?

Working from a document (HTML+CSS) base makes it easier to include a much wider range of people in content creation and design than does starting from JavaScript. It's not just a matter of getting started quickly, though jQTouch is pretty spectacular for that. Starting from HTML+CSS means that a wide variety of people can walk up to the project and change its look with only the mildest understanding of the JavaScript that makes it interactive.

It does, of course, mean that various people can make uncoordinated changes with dangerous consequences, but I don't see the risk of that as particularly greater than it would be with other approaches. In fact, the separation of concerns encouraged by best practices in HTML, CSS, and (unobtrusive) JavaScript seems to me to minimize that risk. It's not that difficult to create an HTML template, limit the variations allowed, and explain those limitations to likely users.

I encourage folks who want to be programmers to give Sencha Touch a close look. For my own content-centric work, though, the jQTouch approach seems vastly more appropriate. Hopefully it'll see a vigorous revival.


You might also be interested in:

4 Comments

Hi Simon,

Thanks for the article! You make a lot of good points and really highlight why we're working on both projects simultaneously. I also just want to point out that Sencha Touch is not necessarily bad for content editors at all. Not all of this is visible from our marketing/download, but:

* Sencha Touch have a flexible templating system which can pull HTML from the DOM, just like with jQTouch.
* It also comes with a crazy powerful data package, so you could work on content in actual databases, etc. — which is even more appropriate for collaborating — and ST will take care of bringing the data in, etc.

Thanks again, and let me know if you have any questions-
Dave

Well said, Simon. I prefer the doc approach myself and also hope for a vigorous revival.

Thanks, Dave - I'll have to investigate the templating system. I'm glad it's there.

I'll have to look again as well. It's not clear how to do this, even from the samples I have.

Thanks David.

News Topics

Recommended for You

Got a Question?