A Case Against Ajax Web Development Model
Ajax is the hottest buzzword today on the web development scene. Everyone is trying to port their existing websites to now make use of the Ajax technologies or just including the name ‘Ajax’ somewhere on the website to claim that they too are in the loop too. I am not totally impressed by the Ajax technologies though.
My primary reservations are with the complete diversion of the path that web development is currently taking towards the Ajax based development style. I have the following concerns:
- Creating websites using a heavy dose of HTML and Javascript is not the most intuitive way of creating complex web applications. After taking all the steps to build convenient abstractions(objects and events) for web development, hence bringing it closer to the desktop development model, its foolish to take one big step back now.
- Not being able to bookmark most of the pages of a website is not going to make anyone, the customer or the website owner, feel happy about it. We come across the same concern with the ‘POST’ data too, but POST method is either used:
- when submitting sensitive information to the server; or
- when sending large amounts of data to the server
No bookmarking should be needed in either of these cases. The same is not the case with the Ajax based websites.
- It breaks the ‘Back’ button of the web browser. Once again, this is not a new restriction; many websites break at many places if the ‘Back’ button of the browser is used, but the problem is compounded to the extreme level when using Ajax.
- I can’t right click on a link to open the target page in a new window. This point may look silly but this in fact is my biggest irritation when using the otherwise excellent Google Mail interface.
- Web developers need to be taught to learn new interface design guidelines. With the liberty of being able to create and destroy any part of a web page dynamically, a bad design can easily leave the user clueless and confused if enough indications are not left regarding what each part of the page tries to accomplish(Flickr demonstrates an example of a good interface). Easy to navigate interfaces are critical for any kind of applications, but the issue gains more importance with Ajax based interfaces.
Its not that I see only drawbacks of using the Ajax technology – with so many great application interfaces being created using this technology every day and so many Ajax applications gaining such widespread adoption, it cannot be without its virtues. It allows some cool effects to be achieved(game website) without having to invest a lot of effort in it – just a basic knowledge of HTML, DOM and Javascript(a skill set that every web developer should be comfortable with) is sufficient. Ajax is not just coolness though; it also helps in creating better interfaces than possible with the traditional web development model, for similar kind of functionality; improves response times giving a more interactive feel to the users; it saves bandwidth, saving time and money in turn.
So when would I use Ajax and when would I prefer to stick to the traditional web development style? For simple web tools(eg: a file uploader/manager, a simple online game, a calculator etc), I would go all the way to use the Ajax technology as it would enable the user to experience the same convenience as that of a desktop application. For complex/moderately complex applications, it should be a tough call based upon the following question: what is most critical for the application, the interface and responsiveness, or the development and the maintenance of the application? Let us admit the simple fact that its not a much pleasurable activity to implement feature after feature using heaps of Javascript code, then writing just enough php code to merely pull the data from the database to return it to the client in some obscure data structuring format.
I would still use Ajax based techniques to pepper up certain parts of the interface though, if I feel like none of the above mentioned disadvantages weigh heavily over the gains that the application can make with them. For example, I wouldn’t use Ajax technologies heavily if I were creating a website like Amazon, though I would still use Ajax to pop up the balloons whenever a user holds the mouse over a product, providing the user with fresh and useful information about it(how many in stock, latest discounts etc).
All the Ajax frameworks that are propping up on the Internet in recent times should help the web developers escape from having to write large amounts of Javascript code, test them, debug them and also from having to maintain them. Such frameworks also use the best practices, thus removing the scope of many design errors that the web developers might commit if they write the Javascript code manually. The Ajax framework that Google has released recently is definitely worth trying out, and I will try to write about it in a future post.
[...] So why should an Ajax developer be interested in the recently released Google Web Toolkit(GWT)? One possible reason could be to overcome the shortcomings of the typical Ajax web development model as noted in my earlier post. Firstly, a framework always provides a head start to a project, allowing the developers to worry only about writing the application logic; user interface elements, the plumbing work needed for the communication between the client and the server are provided by the framework itself. The more specific benefits of using the Google Web Toolkit are: [...]
Great topic, very interesting read. Have added to mailing list.
Many thanks
Paul