I keep hearing alot about how AJAX is the next big thing in web development. Not knowing what AJAX was and assuming it was yet another programming language (like Python, Ruby on Rails, Flavor of the Week, etc.) I’ve sort of just let it go. I mean, I know PHP, Java, Perl, C/C++, Pascal, JavaScript, HTML, XML, ActiveScript, VBScript, PeopleCode, SQR etc. If I can’t do what I need to do in one language, I have several others that I can already choose from. I typically like to wait until I *have* to learn a new language before I actually sit down and do it. These days, that’s a rare scenario.
So I recently decided to begin working on a project that’s been percolating in the back of my brain for some time. I want it to be as totallyuser friendly as possible since my target audience is not all that tech savvy. I’ve been playing around lately with Google’s newer functionality (i.e. Google Maps, Google Suggest, etc.) and have been really impressed with their ease of use. I know from reading an article somewhere that they use the JavaScript XMLHttpRequest object. So I did a little research into it and figured out how to use it. And, man, is this baby cool. It basically lets developers grab dynamic data for a web page without having to reload the page. This is *always* a huge headache. Let’s say, for example, that you have a list of states and a list of cities. If you show all of the data in both, it gets hopelessly confusing. Plus, you don’t want people selecting, say, “California” and “Detroit”. So you want the city list to change according to what state the user selected. In the past, you’d either have to reload the page every time the user selected a new state or you’d have to include every possible city in a series of state-specific arrays. For 50 states, you can easily wind up with 5000 lines of code just for those dropdowns – a totally unwieldly number that affects download times.
Withe the XMLHttpRequest object, the user can select a state and, on the fly, the browser can hit another web page, grab the list of cities for the chosen state and load them into the city dropdown WITHOUT needing to reload the page or preload every possible city. This not only eases page load times, but it also makes code maointenance easier and actually helps the server load (I’d much rather have two hits to the server generating a small amount of data than one hit generating a ton of useless data). So now I’m a total convert on this baby. I figured it out, implemented it into my project and am happy as a clam.
When I was figuring it out, though, I kept coming across sites talking about AJAX. So I looked into it to see what the connection was. Lo and behold:
The XMLHttpRequest Object is AJAX
That’s right. All of the high-falutin’ marketing and crap surrounding AJAX is really nothing more than yet another buzzword being touted to describe the confluence of technologies that already exist. DHTML, JavaScript, StyleSheets and all the other buzzwords – all of which apply to the exact same stuff – apparently weren’t enough to describe it. And herein lies the fundamental flaw in all technology – the need to give everything some unique name as if it’s brand new and oh cool even if it’s just a minor feature release.
AJAX alienated me initially. I’m clearly getting old since I really don’t want to learn new languages unless I absolutely have to. So thinking that AJAX was some new thing with its own syntax, grammar, etc., I avoided it. Come to find out, I already knew it. Why someone couldn’t just say, “Hey, check out what we can do in JavaScript now” rather than trying to brand it as the next hot thing I just don’t get.
Or maybe I do.
Searching for AJAX at Amazon returns 117 books, most of them referring to AJAX coding. By branding it as something new and unique – a whole new paradigm! – technical authors are able to sucker a whole new generation of coders into buying their heavy and overpriced tomes. I mean, which would you rather buy: the Revised Essential DHTML book (which, if it’s truly essential and revised, will have all of the necessary AJAX components in it) or New Essential AJAX? DHTML is soooo 90s. AJAX is totally hip and now.
When technology and marketing collide, consumers take it in the pants. It happens at the lower tech levels (I.e. “Buy Windows ME – it’s so NOT Windows 98! But make sur you buy XP when it comes out or you’ll be left in the dust!”) just as often as it does at the higher levels. In the end, we’re all left with an entirely unsatisfied feeling of not being given what we were promised. No wonder so many folks are frustrated with technology.