[web] AJAX... just another pain in the butt? or worth it?

Started by
36 comments, last by Tradone 17 years, 12 months ago
Ajax certainly has it's uses, but many people seem to abuse it. On dynamic drive they have Ajax text scrollers. WTH?! Why would you use Ajax to get data you only need to get at load time?! Also, using ajax is really quite simple once you get a decent framework to play with. Check out the Yahoo! UI Library. Some nice tools in there.
Advertisement
The usefulness of AJAX is situation dependent.

AJAX is not the panacea some have made it out to be. It is the current buzzword in web programming and will likely be applied to many situations where it just doesn't make sense.

By the same token, AJAX isn't some totally useless technology as the guys over at slashdot would have you believe. There are many people who seem to hate anything that becomes popular just for the sake of being antagonists.

Where AJAX really shines is in web "applications". Static webpages gain very little from AJAX. There are exceptions of course, but if you site is just text, links, and graphics then there's not much for AJAX to do. The real power is in making web sites that behave much more like desktop applications than a webpage.

Bill Gates said years ago that the future was in "thin client" applications. AJAX is one of those technologies that can be used to create such thin client apps. From my own AJAX development and looking at what others are doing i'm sure it's just a matter of time before a robust, Microsoft-Office killer makes it to the browser. It will be the fulfillment of Gate's vision, but judging on how poorly Microsoft is doing on their AJAX-powered Hotmail service I doubt MS will be the one to make such a killer app.

Stating that AJAX is somehow "bad" because it won't work in any browser version made is just retarted. Sure there are still people using windows 95 out there, but that doesn't mean I should ensure my win32 app will run correctly on it. If you want your application to work on every possible platform/hardware configuration/software version, then it won't take advantage of any of them. You will have nothing more than a lowest common denominator program when you finish.

According to my website tracking software, roughly 5% of my web visitors have &#106avascript disabled. Does that mean I should avoid using JS on my sites because of those 5%? Absolutely not. Sooner or later you have to give up on those who are way behind the technology curve if you are ever going to advance the state of your software. Roughly 5% of my visitors still show up at 800x600 resolution, but i'm not coding my pages to be 800x600 friendly. Why make the other 95% suffer because there are a few percent that way behind?

You can still fail gracefully so the users with ancient browsers, JS disabled, or Super VGA screen resolutions at least know why the site doesn't work for them.

~PD
www.ChippedDagger.com"They that can give up essential liberty to obtain temporary safety deserve neither." -- Benjamin Franklin"If opportunity doesn't knock, build a door." -- Milton Berle
Quote:Original post by Cygnus_X
Is AJAX really worth all the extra programming time required to enhance the user interface? Or is it just another big new thing? My vote is currently for the latter.


To be honest I managed to knock up a very quick and simple AJAX interface within an hour. You can come up with a simple protocol for yourself, post all your requests to one place, and get back standardised responses. You can make your life easier by using one of the many kits that exist to make this easier for you, and you can also make it easier by not insisting on using XML for the data transfer - plain text or JSON work better in many cases.

I can see fairly good reasons for using AJAX techniques for a management interface to something. That's to say

- A private area of a web site that web robots have no business visiting.
- An area that people can't access with &#106avascript turned off - because you have control over who they are, and insist that they have it on.
- An area where you have at least *some* degree of control over what browser they use. They won't be allowed to access it from a cybercafe etc, so it's no problem.

Actually using AJAX has the following good implications for your app

- It makes them simpler to write in some cases
- It forces you to make the application with a RPC layer in
- It *can* enable better code reuse - but it can also cause confusion.

My advice would be, if you do use ajax, use it entirely consistently across your application. Use a single entry point that uses the same base code for creating / deciphering requests and composing / processing responses.

You can potentially make the server portion relatively straightforward - adding new functions to the RPC layer can be very easy indeed, as you'd already have the base code.

Then the client portion tends to be more complex - but that's still usually pretty quick to develop.

Mark
Quote:Original post by Michael Tanczos
I think ajax really is the next evolution of the web.

Tragically, yes.

AJAX is just another workaround for the fundamental limitations of the web's synchronous page-based model. <insert W3C haterade> Given the web as it is, though, it has its uses.
Quote:Original post by Sander
Ajax is a great tool if used for the right reasons. "getting quicker load times" is not a good reason. "offering interactivity that is not possible with standard HTML forms" is. I have used Ajax on a website before: I had two dropdown select boxes next to eachother. When you selected an item from the first one, the contents of the second one would change, depending on what you picked from the first one.
This can be done with straight &#106avascript and no Ajax, but it's cleaner with Ajax.<br><br>
---------------------------------------------------There are 10 kinds of people in the world:Those that understand binary, and those that dont...Mage
The silly thing about AJAX is that it's the NC warmed over, yet again. How many more times do the technology strategists have to oscillate between the client/server and workstation/database paradigms?
Quote:Original post by Sneftel
How many more times do the technology strategists have to oscillate between the client/server and workstation/database paradigms?


Easy. Forever. It's the same as the trend for hardware to specialize (separate GPU's, or FPU's) and generalize (GPU's/FPU's becoming general purpose and eventually folding back in the CPU) or the fact that corporations always seem to centralize/decentralize in a 5 year cycle. It's the great osscilating circle of life :-)

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

Quote:Original post by Sneftel
The silly thing about AJAX is that it's the NC warmed over, yet again. How many more times do the technology strategists have to oscillate between the client/server and workstation/database paradigms?


I don't think it's really an oscillation - it's more of a refinement of the existing web development model than a change between client/server and fat/thin.

You could of course treat it as that, but it would be a massive mistake (SQL statements client-side == BAD)

Mark

Quote:Original post by markr
I don't think it's really an oscillation - it's more of a refinement of the existing web development model than a change between client/server and fat/thin.

Sure--of the WEB DEVELOPMENT MODEL. Web development != development. Why is everyone so fired up about AJAX when there are so many other great cross-platform application frameworks available?

This topic is closed to new replies.

Advertisement