Why Prototype?
March 1st, 2008 . by LorisSince I chose ASP.Net as my server side environment, the easiest choice for the AJAX stuff would have been Microsoft’s ASP.Net Ajax extensions. It’s a quite good, well documented library that many other developers have chosen. Plus, it’s completely integrated into Visual Studio.
Why then, did I choose otherwise?
While ASP.Net Ajax is a good choice for many developers, there are some things I don’t like about it:
- I don’t like the concept. “Put everything inside an UpdatePanel to make it asynchronous” seems to be the motto during Microsoft’s presentations.
- I don’t like the standard asp.net controls. Most of the times, they’ll try to render themselves using a table layout. So ’90s.
- I don’t want to mix content, presentation and behavior. Using ASP.Net AJAX controls will inevitably result in poor XHTML code. The classic example is an anchor pointing to a javascript function (
<a href="javascript:__someFunction()">) - Black box syndrome: the javascript code is generated by Visual Studio. This is great when you need to throw out a prototype and “just make it work”, but what about optimization? What exactly is being transferred asynchronously? [note: this could be just me being paranoid]
- It’s easy to do simple things, it’s very hard to do the complex stuff. The whole ASP.Net Ajax concept seems to be geared more towards the creation of simple websites (especially when time is scarce) than complex RIAs. A complex RIA usually consists of a very small number of significant pages (often just one or two) and each of them is carefully thought and planned, down to the single HTML element.
Ok then, but why choose Prototype over JQuery, Mootools, [any other javascript library here] ?
It’s just my personal preference, really. There are a ton of other javascript frameworks of varying quality. Since I had to choose one, I picked my favorite
Feel free to point out how much my assumptions are wrong in the comments!