Ajax is it really worth the pain?

I write this post in a middle of an intense Ajax coding experience and feel it's time to give some thoughts on the rocky journey.

I am an old school programmer and I like to understand every piece of code I am writing, so yes I could have use one of the excellent Ajax libraries available now.

But I feel that for what I need it's just too much. So overall the Ajax experience is positive but I would like to say this (also for the future me):

- Don't underestimate the architecture part with Ajax. I wasted a lot of time rushing too fast in writing code rather than trying to understand how to glue the pieces of the jigsaw together.

- Use Ajax only where it's necessary. I say that now after spending a lot of time replumbing all my server side events to client side ones. You have to convert a lot of Postback events to client side asynchronous calls. A wrong Postback can refresh all your page, losing all the volatile changes you made in the DOM. I am still a newbie on this and I try to figure out how I can keep my lovely Javascript constructed dropdowns after each Postback. Indeed you lost the ViewState!

- In my opinion Ajax is not secure enough for a full e-commerce application. With all the POST and GET methods sent to your server, be ready to add more security issues. Thankfully I don't have to deal with this problem.

- Ajax is not Web 2.0. Well on this one, a lot of people will surely disagree, but with all the Javascript you need to make your app working right, it's rather for me a backward experience, close to the good scripting time with ASP. Sure with Atlas or an Ajax library I can avoid this, but I like to do things by myself.

- Abstraction is not easy with Ajax. I like to make my code generic as much as I can. But with Javascript it's really difficult. Unless you loop using the DOM, finding a specific item other than by its id is quite challenging.

- Why Atlas is not made available for .Net 1.1? I envy all the .Net 2.0 developers who can play with the cool Atlas controls. However, at this moment I am (like many ) still working with .Net 1.1.

- Don't underestimate your debugging time. In Ajax world Javascript is your main language, and when your server side code is ready it's up to your client side scripting skills to be put forward. Welcome to the DOM world!

So yes I invite everybody to give a try on Ajax

No Comments