Challenge: which Javascript library is the best

Lately, I’ve been looking again at the Javascript generic libraries market. And it looks like instead of stabilizing, more and more solutions are available. I do like having options, but at the time you have to pick one things are becoming much more complex. This remembers me of the status of web frameworks in the Java land, and I guess everyone agrees that things are quite messy there.

So, what criteria are you using when picking the solution to be used in your project? Is it your existing knowledge? Is it the quality of the documentation? Is it the maturity of the project?

I have gathered together a list of major libraries. They are listed here in alphabetic order for the moment, but if you start providing pros and cons about them the list will evolve to reflect your feedback. So keep the comments pouring!

  1. jQuery (+9/-0)
  2. Ext JS (+5/-2)
  3. mootools (+3/-0)
  4. mochikit (+2/-0)
  5. prototype (+2/-0)
  6. dojo (+1/-0)
  7. qooXdoo (+0/-0)
  8. Rico (+0/-0)

I will start by saying that I am aware of the quantity of (electronic) ink that have been used covering this subject on the blogosphere so far, but if you help me out with comments/details/opinions (subjective opinions are welcome too😉 ), I am willing to put together a list of pros and cons for each of the above listed libraries.

Posted by: Alex Popescu (aka the_mindstorm)

Update 2008-03-20 12:46: You may wonder why ExtJS with +5/-2 is currently ranked before the mootools with +3/-0. Thing is that one of the -1s is about their licensing model, and as nobody here is a lawyer, we are currently awaiting for more details.

Posted by: Alex Popescu (aka the_mindstorm)

42 Comments

Filed under links

42 responses to “Challenge: which Javascript library is the best

  1. Hey Alex,

    Wanted to alert you to a new JavaScript framework that is nearing 1.0 launch this month: JavaScriptMVC (http://javascriptmvc.com). It aims to bring formal development practices to JavaScript, which it lacks in many areas: things like compression, error notification, model-view-controller, connection to REST API’s, etc. Take a look and let me know what you think.

    – Brian

  2. Hi Alex. Not to start a holy war or anything but IMHO, Ext JS is THE best JavaScript framework out there. From the active community of developers creating plugins, the documentation, the quality of the pre-built widgets and the clean extensible framework, Ext JS is a clear winner. I’ve used other frameworks that you mention in the list extensively and I have not found anything that comes to the quality of Ext JS. Jack Slocum and team have done a great job and the roadmap beyond Ext 2.1 looks awesome.

  3. Good luck with this one – I really am interested to see what you generate through this, as most articles either fall back to the author’s preferences (disguised as “unibiased”) or a “leave it up to you” approach with no real distinction between libraries.

    I’ve had experience using mootools and jquery – I dig them both, but haven’t gotten around to really diving in to see which works better in real-world solutions (of which there are millions of possibilities – one could do accordions better, but maybe one does ajax better, maybe one does ajax and accordions together, better).

    C’mon people, generate some construtive criticism! Show me the numbers!

  4. Alex Popescu (aka the_mindstorm)

    @Brian: I’ll take a look at JavaScriptMVC and see if it falls into Javascript generic frameworks (at a quick glance the name implies a different category)

    @Vinny: you are the first telling us your preference. Thanks a lot. The whole idea of this post is to gather feedback. It will not start a flame war as all messages are moderated, and so only those expressing opinions/idea/critics will be allowed.

    @keif: I usually tend to be as unbiased as possible. And with this post I am trying to get as many opinions as possible (even if some of them will be biased). I have noticed that atm it is quite difficult to gather this kind of feedback in a single place, and I hope I’ll be able to offer at least a start.

    It would be great (and much appreciated) if you and others will be able to push this post so that we get a lot of feedback. At the end of the day, everybody will benefit.

    cheers,

    ./alex

    .w( the_mindstorm )p.

  5. Alex Popescu (aka the_mindstorm)

    3 votes casted

    ./alex

    .w( the_mindstorm )p.

  6. I am currently working with jQuery and I’m pretty happy with it. I chose it over prototype, I dont know much about the other libraries. So… +1 to jQuery.

    Cheers

  7. GuyMac

    jQuery (and John Resig) seems to be the sharpest tool in the shed, so to speak.

  8. I woudl say -1 to extJS because of their licensing

  9. +1 for ExtJS (wonderfully complete)
    +1 for Dojo (accessibility / graceful degradation)

    Jason
    http://blog.jasonharrelson.com

  10. http://jquery.com/blog/2006/10/18/zebra-table-showdown/
    http://www.zenperfect.com/2007/08/11/javascript-frameworks-compared/

    Just more info😉

    It’s more than just speed, but size and ease of development. I’ve found mootools really easy, jquery is easy to jump back in to, and I’m currently in the process of converting some of the mootools code I/coworkers used and making it jquery compatible (and will continue to do so with other libraries as well).

    I’d almost say +1 to jquery and mootools, but it’s unfair because I really haven’t compared them to what matters.

  11. kononajax

    +1 for Prototype.

    just because😉

  12. Casey

    While I love ExtJS, it is just so huge. I really liked the ‘custom build’ that was in ExtJS 1.x, but that feature does not seem available to 2.x.

    YUI is a very well built, intuitive library … with very good documentation … almost as good as ExtJS. It is also modular. Allowing you to pick and choose the required modules to load. However, this imposes complications when setting up your page … Not too hard, but still an issue.

    ExtJS is more of a kitchen sink approach … but, a very nice kitchen sink!

    There is a good bit of overlap with YUI and ExtJS … so, I usually use YUI as the ‘base’ and then load the ExtJS ‘on top of’ the YUI stuff when needed.

  13. Sergio Pantano

    I am working with jQuery in the last 3 months and it is my first Javascript library. The learning time was quickly and fast, it has a good plugin’s.
    I don’t know the others but I indicate it with certainty!

  14. Alex Popescu (aka the_mindstorm)

    @Donald: casted your -1 for extJS. Mind to share with us what is wrong in your opinion about their license?

    @keif: I know that trying to be objective is hard, that is the reason I have said I will accept any comments🙂. Vote casted!
    Thanks for the links. The 2nd one is quite good but is covering a larger base. I am very interested in generic frameworks (and not UI related ones).

    @kononajax: good point😉

    @Casey: how should I count your vote?

    Thanks to all of you. If possible please try to keep it going by pointing other people to this poll.

    cheers,

    ./alex

    .w( the_mindstorm )p.

  15. Alex Popescu (aka the_mindstorm)

    7 more votes

    ./alex

    .w( the_mindstorm )p.

  16. I’ll explain why i voted for Proto.

    First, when i came into Ajax world, I was PHP programmer, and I was not really so good in OO concepts and stuff, and my first library was moo

    damn that was confusing🙂

    After that i spent some time polishing my JS skills, and reading about various libs, and finally decided to go with Prototype.

    And it felt sooo god, so natural, i really can’t explain that.

    Learning Prototype also really improved my PHP programming skills, and helped me to grasp better understanding on whole OO concept and different OO patterns. It simply made me think, and made me a better programmer, and it was damn fun at a same time.

    After some time Ext, and jQuery showed up, and there was enormous buzz on them, I tried them both, but it just was not for me…

    Must be one of those personal things🙂

  17. tim

    It depends on where you’re coming from. If you’re a Python programmer, for example, Mochikit will make you feel almost right at home. Mochikit+=1;

    But the one library (well, it’s more of a compiler) that really blew me away was Parenscript. But then, if you’re not a Lisp programmer, you’d probably hate it. Similarly, I know some people swear by GWT, but I can’t stand Java, so that’s a non-starter for me. (incf Parenscript)

  18. +1 for Mochkit. It’s got stellar documentation, and the best event model of any JS library.

    +1 for jQuery. Big props for the no-conflict mode, which makes it easy to use alongside other JS libraries.

    -1 for YUI. Lots of focus on widgets, very sparse on basic stuff like DOM manipulation. Various different and confusing ways of handling events.

  19. I’ve done project work with mootools, prototype, yui, and jquery.

    jQuery is clearly my favorite now. The syntax and use of css selectors to drive interaction is so obvious and fun to program with.

    YUI does have a LOT of features coming out in their latest releases and is really the only worthwhile competitor to jQuery..

    ExtJS and Dojo are in another category of tools, IMO.

  20. I’m not entirely sure ExtJS fits in correctly with this – as far as the client side stack is concerned ExtJS can sit on top of prototype/scriptaculous, jQuery, Dojo, etc etc etc. Currently I don’t believe there is much available to compete with Ext at its level – which is much more targeted at gui components than the scripting and animation frameworks that the rest target – even though Ext also contains a lot of the features of the other frameworks.
    Personally (and most important – currently) my favourite stack is Prototype – Scriptaculous – ExtJS. This weighs in quite heavily initially but once you have selected the specifics and compressed everything it works quite nicely.
    Prototype is fantastic for improving whats lacking in javascript.
    Scriptaculous sitting on prototype provides all of the low level animation and gui “functionality”
    Ext provides all of the GUI components and is a fantastic to work in at the higher level.
    SO…. +1 to Prototype and +1 to ExtJS from me – even though EXT isn’t really something to compare against the others ;p

  21. Just a Coder

    -1 for extjs.

    jQuery is the best library currently available.

  22. Jeff

    @Donald, I’d say your -1 for ExtJS deserves some clarification about your issues with the licensing for it to have any weight.

    @Casey, the custom build for ExtJS 2.x is available just like the previously available 1.x. Further, the size you complain about is a relative non-issue when you use (what I consider to be mandatory) gzipping. Gzipped, ext-all.js weighs in at only 133KB. Considering ext-all.js is really only appropriate for use in single-page apps, you’re really only sending it down the pipe once for each user that hasn’t already cached it.

  23. Miguel Benevides

    +1 Ext.JS ( anyone who asks why … you didn’t try it )

    +0.9 jQuery (fantastic and almost as fun to use as playing sudoku… if you’re not building a BIG app)

    +0.9 mootools (these guys invented sudoku?)

  24. Animal

    It really has to be ExtJs.

    It’s apples and oranges in some cases. jQuery may be cool and terse and have good effects, but it is not a ground-up, integrated page-laying out system like the Container/Component architecture that is at the core of ExtJs.

    The concept of layouts (eg border layout) came late to other javascript libraries, and while some now have it, it seems uncomfortably hacked on.

    In ExtJs, any Panel (or subclass) may have a layout manager (and there are several types of which “border” is only one example). Any child Components of this are layed out accordingly, and THEY may have layouts.

    With this architecture it is easy to build a fully liquid, desktop-like application.

    Clever widgets in isolated islands of HTML cannot do this.

  25. Alex Popescu (aka the_mindstorm)

    Firstly, I’m noticing that people are starting to mention YUI in this thread. Is this a generic Javascript framework? My impression was that its focus is more on UI. Indeed, it does have a couple of generic features, but not something that can be compared with the other libraries.

    Also, @Paul Irish and @PrecariousPanther are mentioning that ExtJS and respectively dojo don’t have a place in the generic framework list. Now, I don’t know much about ExtJS, but as far as I can tell dojo is generic enough. It is covering also UI, but it has a lot of additional functionality guaranteeing its place in this list. But, I may be wrong, so I’m planning to write another entry discussing this topic and using its results to decide.

    @Jeff: I’ve asked @Donald to clarify his stand point about the license. IANAL, so I will just mention that ExtJS has 3 different licensing models that can be found here.

    @Miguel: you got me confused with your votes🙂. Should I use a double or float type to add your .9s? Or am I allowed to just round it to integer?
    And I like the argument about ExtJS🙂.

    @all: thanks a lot for your feedback. If you have friends/colleagues that you know may help us further discuss this topic, I would be thankful if you push them to comment here.

    cheers,

    ./alex

    .w( the_mindstorm )p.

  26. Alex Popescu (aka the_mindstorm)

    7 more people

    ./alex

    .w( the_mindstorm )p.

    PS: I’ve rounded the .9 to 1 as I like keeping things simple😉

  27. Alex Popescu (aka the_mindstorm)

    @Animal: thanks for your comments. And I am apologizing for repeating myself, but my intention was to look for generic frameworks and not to those specifically meant for UI. I am starting now to look myself into ExtJS and YUI to see if my decision to include the first one and exclude the 2nd was good or wrong.

    @all: if you think the above decision is wrong just let me know and I will fix it.

    cheers,

    ./alex

    .w( the_mindstorm )p.

  28. This is like comparing apples with oranges.

    ExtJS is by far the best framework to build web applications. It has a great structure, good community, fantastic extendability and a neat pixel-perfect UI. Saying its too big is unfair, cause it offers so much more then any other framework.

    If you want to use a javascript library to spice up your website, I would go for jQuery. It has a small footprint, great docs, alot of plugins and easy syntax.

    So my conclusion is:
    +1 to ExtJS for application development
    +1 to jQuery for website pimping

  29. ffzhuang

    Vote for EXTJS. Most of my javascript experience is for UI purpose, I will definitely pickup extjs when I build rich UI. Extjs covers nearly all of the UI component I need to build application. It is easy and quick to pickup/understand if you are OO guy. The full architecture idea is clean.

    Fenqiang Zhuang

  30. Alex Popescu (aka the_mindstorm)

    @Tommy Maintz: would you mind defining which are the apples and which are the oranges?

    I’ve started to look a bit into ExtJS, and I guess to keep things a bit more clear I should specifically mention that the version I’m interested in is the 2.x branch.

    cheers,

    ./alex

    .w( the_mindstorm )p.
    Alex Popescu

  31. I think *best* is relative to the application of the framework.

    For enterprise level applications, I certainly choose Ext. For public facing websites, I’d typically look to something lighter weight.

  32. @Alex Popescu

    Although Prototype/Scriptaculous, jQuery, mootools and mochikit (don’t know much about qooxdooo and Rico) offer UI components in the form of plugins and extentions, their core goal is making DOM manipulation, events, animations and XMLHttpRequest work cross-browser and easy to use. Those are the apples.

    Dojo and ExtJS are full-fledged UI libraries, offering users the possibility to create very complex application interfaces. They are the oranges.

    ExtJS even offers the possibility to use jQuery, Prototype/Scriptaculous or YUI as its core to handle DOM manipulation, event handling, animations and XMLHttpRequests. It has adapters that bridge ExtJS to those libraries. That should already show the difference between what ExtJS and the other libraries have to offer.

    The reason I like ExtJS better then Dojo is because of its extendability (great code structure), pixel-perfect UI (lovely graphics) and community.
    There is basically no javascript library currently available that comes close to the power of ExtJS.

    Maybe I’m wrong on some points, but I used most of the libraries mentioned here in different projects, and this is what I experienced.

  33. +1 for jquery I never need to use any other js library my first and last is jquery.

  34. A couple of things to consider when comparing:

    Size of the library. If you’re looking for lightweight, jQuery’s probably a much better option than YUI.

    IDE/framework support. Script.aculo.us, jQuery, Prototype JS seem to have better built-in support in IDEs and IDE plugins like Komodo, Eclipse, Zend Studio than the others. Drupal has chosen to ship jQuery with their latest versions and CakePHP, Zend Framework, and other PHP application frameworks have made decisions to build in support certain libs.

    Who’s the developer? Someone with a programmer or design background? Some of these libs require more than just a passing knowledge of OO JavaScript to get beyond adding standard widgets.

    Script.aculo.us and YUI must be added to this list.

    Great discussion!

  35. ExtJs offers its library under LGPL.
    I.e. you can use it in a commercial web site, without having to open up your source code as well. BUT if you make changes to ExtJs, you have to provide the possibility to download the source code to your changed ExtJs. (With JavaScrip in the browser, that is no issue).
    What you can’t do: Create a library that contains ExtJs and sell/offer that library, without offering the source code of your library as well. I.e. your library must use LGPL as well.
    I think that for everyone, creating a web site that uses ExtJs, this should be okay.
    Disclaimer: I have nothing to do with ExtJs and am no lawyer, but had to dig into the licensing stuff previously.

  36. Noah

    If you include ExtJS, you must by default include YUI.

    -1 for ExtJS thought, since they changed their licensing structure from LGPL to GPL.

  37. I have used jquery on 6 different projects now.. I used to hate javascript, now I use it too much! +1 for jquery

  38. Probably a little late to the party but I’ve used Prototype and ExtJS extensively and they are not really fair to compare.

    That said, I love Prototype.

  39. Emad

    I love jQuery, it is my favorite but read my post at http://www.emadibrahim.com/2008/08/10/the-best-javascript-library/ for a surprising conclusion. Well, at least it surprised me.

  40. +1 for Mootools, due to their object oriented approach, making it muuuuch easier to create clean, reusable code.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s