Archive for March 10th, 2006

Friday, March 10th, 2006

Why AJAX sucks

Ok, ok, so the title is a bit strong. The truth is, I think everything sucks to some extent. And I should mention that I’m a long-time Flash RIA (Rich Internet Application) developer. Now that we have that out of the way, I still think AJAX is pretty cool. I thought it was even before some bastard gave it a buzzword and it was still called DHTML and XMLHttpRequest circa 1999. ;) My complaints with it then pretty much stand today. I hate Javascript. Not the language, necessarily, but the implementations of it. A huge problem is cross-browser differences. I should not have to write script to accomodate implementation differences between browsers. One of the reasons I love Flash is because the same code runs the same way in any Flash player (*keep your esoteric exceptions to yourself).

Another huge problem has been error handling (less so since Javascript >= 1.5, which is included with the latest mainstream browsers). If your Javascript breaks for some reason, all the user gets is a little non-descript icon in some corner of their browser and the rest of your script stops working. They don’t notice it. Hell, I hardly notice and I’m usually looking for it. And depending on how much your application relies on Javascript, the user could end up with a blank, incomplete, and/or unusable user interface. That is an utter nightmare for serious applications, one I suffered with a lot when I was developing a prototype of my early-draft SCORM-based Learning Management System (LMS) a few years ago. It was 7-8K lines of Javascript at that point. And there were all sorts of gremlins that kept it from being as stable as we needed it, despite proper coding practices and numerous workarounds to keep things from flaking out. Ultimately, we scrapped that and re-wrote it mostly in Flash, where it proceeded to kick an enormous amount of ass. Honestly, there should be a standard, uniform, no-brains-required way to catch and report errors back to the server and handle them gracefully on the client.

Third, and this comes mostly from spite, although the point is still wholely valid: The same people that complained about HTML frames and those who complained Flash not being SEO-friendly, back button-friendly, or accessibility-friendly (nevermind being a proprietary product of an evil corporation) should be complaining about AJAX. Many of those same issues, which I agree with to a certain extent, still apply to AJAX as well.

“AJAX” is being hyped (along with its equally Buzzword Bingo-worthy illegitimate lovechild “Web 2.0″) as being some sort of magical panacea. It’s not, by any stretch of any imagination. But, like with XML in the late 90’s, we’re going to see AJAX is every web-related job description known to man, whether it’s appropriate, legal, or congruant with the laws of nature. All of that being said, it is pretty cool to be updating parts of your page dynamically that would otherwise require full page refreshes…and I’m using it on a few projects. ;)


3 Comments » - Posted in Uncategorized by Jacob