Arjan's World: AJAX: No Silver Bullet?
You are now being redirected to the new housing of Arjan's World. Click here in case nothing happens

Wednesday, June 29, 2005

AJAX: No Silver Bullet?

Read an entry on AspNetResources.com today where the author urges some care in adopting something as new as AJAX. AJAX is supposed to be the new silver bullet around. While on the one hand *everybody* writes about it, uses it, and new AJAX-libraries are released on a daily basis, I really have doubts about this. The article cites the famous Coder to Developer by Mike Gunderloy where he warns to be careful about these silver bullets which are suddenly there, promise a revolution in programming, software development or whatever; only to disappear quietly and anonymously through the backdoor some time later. Citation:

When you read an article about some hot new technology, resist the temptation to immediately add it to your code. Instead, write it down on a sticky note and stick it to your monitor. If your application really needs a distributed reflection-based plug-in API, it will still need it in the morning. If not, it’s a lot easier to rip off the sticky note than to roll back the code changes

I read Mike's book with great interest, and I think his argument is a very compelling one: silver bullets are indeed things to watch for, but also to be quietly debated for their use/not-use/abuse etc. There just may be a situation where you can make very good use of something, as long as you take care not to use it *everywhere*.

I have to admit, that when I first read about AJAX, I also didn't think much of it. However, after being given a more thorough introduction by way of *the* AJAX primer by Jesse James Garrett (go read the article now if you haven't already) who coined the term I started to see it's possible benefits. The most obvious being of course that no page reloads or fetching serverside data after user actions are necessary anymore. Literally tons of nice applications like Backbase seem to have popped up suddenly the last few months, and one starts to wonder if it's really a completely new technique. Well, of course it isn't. It is just a clever rehashing of JavaScript - being around for something like a decade -, the XMLHttp object and a smart use of XML-documents flying around behind the scenes. All ingredients have been around, it only had to become 2005 before someone got to putting a nice label on the combination yielding to such a nice dinner :)

I have to admit it took me some time to get it working at first. Using the code in a much referenced Apple code sample showing AJAX technique in my own application was a bit more cumbersome than I thought. You get to learn a lot about well-formed XML in the process, for example a " in the input was really giving the implementation a big headache. It takes some time to learn that encoding is very important in XML documents (yes, I have seen XML before, but have not built it myself until then).

Conclusion: my opinion is that AJAX is definitely a useful way of working. But it is important to keep in mind that you should develop with the user in mind, and not use the technique for the technique. Is your end-user profiting from your clever use of a new acronym, is your application behaving like the user expects, then by all means use it!

0 Comments:

Post a Comment

<< Home