The right tool in the wrong hands
Category rants
When I first heard about AJAX, I instantly loved the idea because of the context in which it was presented: an approach for sending the server only what it needs to know in order to tell the browser only what it needs to know. Ever since, I've heard numerous tales of AJAX being used inappropriately - mostly as an excuse for the developer in question to "look cool" by using it. Honestly, I wish whoever originally coined the term "Web 2.0" hadn't; that's just an invitation for folks to attempt to prove they're on the cutting edge. But this stuff isn't particularly new, it's just being used in new ways, and like all tools, in the wrong hands it can spell disaster. Even JSON isn't new... it just has an acronym now, so suddenly we're all discovering what's been there all along, lying dormant.
Several folks have linked to the latest WTF as an example of AJAX gone ridiculously wrong. I've even seen some chatter lately discouraging any use of AJAX because it creates a burden on servers and networks. But I feel inclined to point out that appropriate use of it isn't. Consider as an example of an appropriate use the default behavior of Domino combo boxes that use the auto-refresh option. Left to its own devices, the default implementation not only triggers a page refresh, but also causes the entire form to be submitted to the server. On a very basic form, that's no problem. But if the form is rather lengthy, and the first two fields are drop-downs - the second of which depends on the value of the first to determine its selectable values - AJAX would provide a much more responsible approach (especially if it's using JSON, not wrapping everything in XML tags); send only the value of the field that changed, return only the values that should now be selectable in the next field. In this scenario, the server gets involved as often as it would have anyway, but less data is exchanged.
Even in the case of a basic form, AJAX is occasionally more respectful of bandwidth than the alternative... and that's when the site design is complex and/or busy. If the form itself is surrounded by top navigation, left navigation, footer information, a couple right sidebars, and some graphics (oh, say, for example...... this site), why bother asking the entire page to be downloaded again (yes, I know, there's a little thng called a cache, which saves so much bandwidth... unless of course your users decide to disable theirs) when you could just send a few bytes of data and get a few back?
So please, those of you that use this tool to feel (and, yes, appear) cutting edge, consider whether its use is actually appropriate before doing so. Otherwise, others who are genuinely trying to improve user experience and conserve system resources may soon encounter a fair amount of resistance during code reviews.
When I first heard about AJAX, I instantly loved the idea because of the context in which it was presented: an approach for sending the server only what it needs to know in order to tell the browser only what it needs to know. Ever since, I've heard numerous tales of AJAX being used inappropriately - mostly as an excuse for the developer in question to "look cool" by using it. Honestly, I wish whoever originally coined the term "Web 2.0" hadn't; that's just an invitation for folks to attempt to prove they're on the cutting edge. But this stuff isn't particularly new, it's just being used in new ways, and like all tools, in the wrong hands it can spell disaster. Even JSON isn't new... it just has an acronym now, so suddenly we're all discovering what's been there all along, lying dormant.
Several folks have linked to the latest WTF as an example of AJAX gone ridiculously wrong. I've even seen some chatter lately discouraging any use of AJAX because it creates a burden on servers and networks. But I feel inclined to point out that appropriate use of it isn't. Consider as an example of an appropriate use the default behavior of Domino combo boxes that use the auto-refresh option. Left to its own devices, the default implementation not only triggers a page refresh, but also causes the entire form to be submitted to the server. On a very basic form, that's no problem. But if the form is rather lengthy, and the first two fields are drop-downs - the second of which depends on the value of the first to determine its selectable values - AJAX would provide a much more responsible approach (especially if it's using JSON, not wrapping everything in XML tags); send only the value of the field that changed, return only the values that should now be selectable in the next field. In this scenario, the server gets involved as often as it would have anyway, but less data is exchanged.
Even in the case of a basic form, AJAX is occasionally more respectful of bandwidth than the alternative... and that's when the site design is complex and/or busy. If the form itself is surrounded by top navigation, left navigation, footer information, a couple right sidebars, and some graphics (oh, say, for example...... this site), why bother asking the entire page to be downloaded again (yes, I know, there's a little thng called a cache, which saves so much bandwidth... unless of course your users decide to disable theirs) when you could just send a few bytes of data and get a few back?
So please, those of you that use this tool to feel (and, yes, appear) cutting edge, consider whether its use is actually appropriate before doing so. Otherwise, others who are genuinely trying to improve user experience and conserve system resources may soon encounter a fair amount of resistance during code reviews.








Comments
Posted by Tim Tripcony At 22:19:02 On 08/01/2006 | - Website - |
AB changed our process - it now takes 70 (not exagerrating) steps to go from INFO ticket to production - with no less than 2 different triage processes along the way. You are missing the good stuff here.
How'd your move go? WE MISS YOU
Posted by Dan At 16:31:15 On 08/01/2006 | - Website - |
Vince DiMascio has an example of using this approach quite well:
http://www.vincedimascio.com/vince/vpd.nsf/all/93CFF6FC0D84042388257190007690E0
The primary intent was to demonstrate integration between Google Maps and Domino, but it is also an elegant demonstration of how JSON allows view data to be easily resorted and recategorized on the fly.
Posted by Tim Tripcony At 00:54:28 On 07/20/2006 | - Website - |
Sean---
Posted by Sean Burgess At 23:45:53 On 07/19/2006 | - Website - |
Posted by Dan At 11:45:56 On 07/21/2006 | - Website - |
Posted by Tim Tripcony At 21:48:24 On 07/24/2006 | - Website - |
Posted by Dan At 12:47:17 On 08/03/2006 | - Website - |