Which JS Framework is “The Best”
After my recent tutorial was posted on NETTUTS, I found the feedback filled with comments such as:
Jquery is the best and can be used to do all of this stuff plus more.
and
Yeah, I agree NETTUTS should only go away from jQuery when it can’t perform something
Reader Tim commented:
Nice. but which is best? Scriptaculous, Mootools, jQuery, or Dreamweaver CS3 built in apps?
What amazes me is not the sentiment so much as it's the nearly religious zeal with which these people are dedicating themselves to a code library. So I wanted to take a moment to examine the question without that same type of bias--Which JS Framework really IS "the best?"
To attack this problem, we should first really define what "the best" means. After all, if some code library is worth this type of devotion, I want to be pretty damn sure that it's the best! So what does it mean to be the best Javascript library? Here are some thoughts:
- It's the smallest
- It's the fastest
- It provides the most functions
- It provides the strongest application structure
- It provides a plugin system
- It provides clean methods to implement Object-Oriented Programming
- It integrates with a powerful back-end development platform
- It provides easily maintainable and extensible code.
- It's the most widely adopted by the biggest sites
That list was literally written in 30 seconds off the top of my head; I'm sure the true criteria to establish which Javascript library is the best is a far longer list. That said, we'll use these 9 criteria. What do we notice about these requirements? If you answered that some of them lie in nearly direct opposition to each other (such as 1 and 3) you're right. If you answered that some of them can compensate for weaknesses in other areas (for example, 5 or 8 and 3) you're also right. Even with a short list of 9 requirements, we know two things:
- No one library is going to meet all of these criteria
- Not all of the requirements are always requirements
If you're busy debating which Javascript framework is "best," you're fighting a religious war that cannot be won; simply put--no one Javascript library can be objectively defined as "the best."
Gee, thanks Brian. But which should I use?
In my opinion, for every project, you should evaluate which library makes the most sense to use. It is certainly reasonable to have a preference (for example, you may feel that jQuery works for about 75% of all the project work you do) and that's great. You may even find areas of overlap where you continue to use your preferred framework simply because it makes sense. For example, if you know prototype very well but are less experienced with jQuery, you may want to choose to use Prototype in the interest of speeding development even if based solely on the requirements of the project jQuery would be a "better" choice.
My personal opinions
Since you're reading my blog, I will give you what I consider to be my reasonably well-informed personal opinions of the libraries I have worked with and when they make sense:
The library I'm most experienced with is Prototype. The primary reason is that it is the library we have standardized on here at AutoTrader so I work with it extensively on a daily basis. My feelings on Prototype are that it is a great library that provides a lot of great functionality, is for the most part reasonably quick (with some notable exceptions). Both jQuery and MooTools have their roots in Prototype, so moving between those 3 libraries are probably easier than moving to and from others. For general development, my familiarity with Prototype makes it my first choice. The biggest thing Prototype has going for it is its implementation of classes and inheritance easing the transition for those very familiar with object oriented programming.
For everything I like about Prototype, I dislike Script.aculo.us. The way its implemented seems silly to me (creating a new object for each effect is how you execute the effect?) and it doesnt "fit" well with Prototype's code style. It lacks an implementation of Robert Penner's easing equations which make its animations look less impressive.
I have a strong love of jQuery; it's incredibly small, incredibly fast, and very much follows the paradigm of "get out of the way." The plugin architecture is fantastic, and the jQuery UI library is great--fully integrated with the jQuery style of coding and integrates everything I'd expect from a fully-featured animation library. These guys have taken the concept of dereferencing objects to an extreme level--and it can make jQuery code difficult to read at times when you have one line that chains 35 methods. That said, once you understand its power; its actually quite elegant.
MooTools is another great library, and if you're looking to do a lot of heavy animation work, I'd even suggest it over jQuery. MooTools began as an animation extension to Prototype that evolved into its own library--but their heavy focus has always been on providing the fastest, smoothest animations of any library. Obviously its not limited to only animation work; but that's certainly where the bulk of its strength lies.
I'd also like to mention SproutCore--if your goal is to build a fully functional application within a web browser that relies less on Ajax and animation and more on solid application architecture, SproutCore appears to be an excellent choice. I have far less experience with it than other libraries, but from what I've seen, it's MVC implementation is quite impressive!
I'll refrain from in-depth comments on other libraries with which I have no experience--but there are certainly a multitude of choices out there!
Always remember to take your requirements for the library into account on a project-by-project basis--and don't be afraid to work with multiple frameworks. It only makes you that much more valuable to an employer!
I am a User Interface Engineer working for AutoTrader.com in Atlanta, GA and I've been on this crazy ride called Web Development since 1997. Along the way, I'd like to think I've learned a bit and this is my forum to share it.

Interesting article! While it makes sense in theory, I think the suggestion to evaluate which library is most suitable for each and every project isn’t very practical and fails to take into account an individual’s experience/familiarity with a particular library. Perhaps library X isn’t the ideal choice for project P, but if you have to learn several other frameworks just to be able to determine whether or not it’s the right choice, then it might be simpler not to use a library at all.
That said, as frameworks become more established, the decision as to which one is most suitable for a specific application might become common knowledge.
With this in mind, I tend to think Adobe Spry provides good support for progressive enhancement and SEO, while Gapjumper has some useful (and easy-to-use) animation features.