Matt likes to provide the dissenting Ajax voice here on untyping.
As overhead on Slashdot:
‘Zimbra’s chief executive, Satish Dhamaraj, says that when he started his company in December 2003, “I really thought that Ajax was just a bathroom cleaner.” Now his San Mateo, Calif., business has amassed $16 million in funding from venture-capital firms including Accel Partners, Redpoint Ventures and Benchmark Capital, the firm that famously funded eBay Inc. Peter Fenton, an Accel partner, says Ajax “has the chance to change the face of how we look at Web applications” and could boost technology spending by corporations, because Ajax is also being used to develop software for big companies, not just for consumers.’”
Ajax is a dangerous and immature technology. It is, in fact, a hack—akludge—to provide rich-client functionality in the browser.
What do I mean? Pretend that every HTML element has a shape. If that’s the case, then a document with a series of paragraphs might look like:
In this picture, the octagon represents the
tag, and the circles represent the paragraphs. If emphasis
tags look like a small square, then (zooming in) our picture might look like:
Unfortunately, to make Ajax work, you have to constantly reorganize this tree. The tree is everything
: it is the UI, it is the content, and it is the data for the program you are writing. And, I can casually replace any one node with a new node of a different type, or
I can insert whole, new subtrees.
Anywhere. Anytime. And, without any validation or safety. So, I can take my first picture, and insert an entire copy of it anywhere I like:
The only problem with this is that, if the octagon is a
tag, this iscompletely invalid HTML
. But that’s not the worst of it; the tree representing all of my interface, content, and data is a massive, and complex, piece of state. So, after part of my program modifies the tree, I have to forever remember that the state has changed. Keeping track of state is already a dangerous part of programming; it is the cause of crashes in unithreaded programs (memory leaks, for example), and a source of huge problems in multithreaded programs (via problems known as deadlock, livelock, race hazards, etc.). This is why Google Mail and other Ajax-y applications are a miracle of hackery: the fact that they run, without completely buggering up constantly, is a nothing short of a holy intervention on the part of some higher being.
It may be that Ajax is just the most portable, and least rich/safe way to develop applications for end-users at the moment. Rich clients, likeOpenLaszlo
, represent a greater level of safety, as well as a much richer set of tools. Widgets, like Apple’s Dashboard and Yahoo’s Widgets
, an excellent, cross-platform predecessor to Apple’s Dashboard) provide some of the ease of development of the WWW with much of the richness of the desktop—yet there is a run-time engine that provides a modicum of protection and safety for the end-user. And, of course, desktop applications: they sacrifice portability, but give you the full power of the host machine.
<BLINK> tag of the new millennium.
Then again, PHP exists, and it’s a large, steaming turd of a language that grabbed significant market share entirely too easily. So, what can you do?