Choose your framework
Gone are the days where you have to write extensive, ugly javascript code to manipulate page elements and DOM. Thanks to the development of some really great javascript frameworks you can do more with less (that sounds like a line out of a Walmart commercial). The big three libraries are jQuery, Prototype (with or with-out script.tac.ulous) and mooTools. Each has its advantages and disadvantages (A major disadvantage to all three is that it’s very difficult to work with more than one at a time). Just like shopping for a new car or deli sandwich, how do you know which one is right for you?
The debate on which javascript framework to use is an even bigger then the DIV vs TABLE debate (another article for another time), and plenty of opinions have been voiced. For example, Glenn Vanderburg who runs the blog Relevance recently wrote an article (on my birthday no less) about how he prefers Prototype over jQuery.
jQuery is a very nice piece of work, and makes some common tasks easier than their Prototype equivalents. Where it’s good, it’s very good indeed. But its design is uneven, and its scope is limited. For me, at least, Prototype is still the tool of choice. I think it’s a richer, more thorough, and overall better designed library.
In his artcle (I’m not going to post the whole thing, that would be plagerism) he explains many great points for both jQuery and Prototype, along with code examples to show his opinion;
So while jQuery might be easier to get started with, Prototype grows with you better. Most web developers get started with JavaScript by doing relatively simple DOM manipulation, and jQuery really excels there. But as you get more comfortable and begin trying to do more, you may find that jQuery doesn’t help you as much. Prototype makes JavaScript programming lots of fun even in circumstances where jQuery feels constraining.
Basically he explains that jQuery is nice framework, its more for programmers who are beginner / intemediate DOM manipulators, and Prototype is for more hardcore stuff. An opinion that I can agree with having both used jQuery and Prototype in projects. For example, in my senior year of College I was part of a development team and we were building a Project Management System. We had disxcussed that we wanted it to be ajax based, and as the lead developer/programmer it was my duty to make it function smoothly. At the time I had barely any experience with major DOM manipulation except for straight up javasript. The Team leader opened me up to jQuery, which I was able to pickup fairly quickly and easily.
In another blog by Trent Richardson (trents blog) he compares jQuery and MooTools ;
Mootools has previously been known for its silky smooth effects and great dom utilities, but they also have performance on their side as well. jQuery on the other had has to have the friendliest syntax ever with chaining and selectors, with just enough effects to make you hungry for more.
MooTools does in fact have the best preformance out of the bunch, Peter Velichkov over at his blog did alot of speedtesting for each of the major frameworks (it originally inspired me to write this article) which showed across the bored mootools was the fastest preformer.
So which framework is the best?
The true answer (which you’ll probably hate) is there isnt a best one. It’s all based on circumstance, for example if you wanted something lightweight and easy to use I’d go with jQuery. If you wanted something robust and powerful I’d go with Prototype, or if you wanted something really fast I’d pick MooTools.
Another factor is ease of use. You have to figure out which is best for you depending on your programming level. jQuery (easy), Prototype (intermediate/hard), MooTools (intermediate/hard). The more comfortable you feel with the tools your using, the overall better product you’ll produce.
I personally, prefere to use jQuery simpley for its ease of use. I can write powerful javascript functions very simply and fast alowing me to get more done in a shorter amount of time.

One Response so far
Rob
February 27th, 2009
3:39 pm
I have just recently started using jQuery and have to say I love it. I used script.aculo.us in the past, but nothing extremely extensive outside of their standard functions. With jQuery I’m creating much more efficient javascript through it’s extremely easy syntax. Along with its ease of use I’m finding almost an endless amount of functionality and plug-ins built for its library. Not to say the others don’t have a plethera of options, but from other articles I’ve read including this one, I’d have to say jQuery is the one to use. Or at least begin with.