Showing posts with label choose. Show all posts
Showing posts with label choose. Show all posts

Saturday, October 10, 2009

A Criticism of Ajax

Now please don't get me wrong I am all for Ajax if the requirements need it. However lately some things have made me wonder when to use Ajax and when not to....

Some times things just annoy me the way semi technical people come up with design decisions.
Some time back I had been working a very capable requirements analysis and he promised Ajax on pritty much every page the client had. I was a part of these discussions and I had a word with him offline why have Ajax for a bunch of simple forms in which a user will enter Fret data.

You may be surprised or shocked, his answer was in 2008 you can't build 1998 style web site. Come on dude thats no answer. Ajax costs more in development, testing and implementation. Getting it working across browsers is fun in itself and your clients don't want it.

Using Ajax for the cool factor is just not right. I have come up with some guidelines around when to choose ajax and when not to.

When not to choose Ajax
1. Because it sounds cool.
2. Because every one else does it.
3. Because you want to avoid the page refresh.

When to choose Ajax
1. When some of your controls get loaded based on user choices in other controls and the data is just huge to be cached on client side, for example on choice of a country you display cities and on choice of cities you display zip (pin) code
2. When you know you can write good java scripts (and java scripts are different from the DOM of the browser)
3. When the cost of getting all the data on start of the page is higher.

DONT APPLY AJAX ON THE ENTIRE PAGE.

Please note Ajax degrades server performance

I am glad I have said that, guys we should remember technology is present to solve business problems not for the cool or sales factor. Clients value honesty.