jQuery’s Latest Stab At Competence

Posted by Matt at 11 February 2009

Category: Programming, javascript, jquery, web

jQuery underwent some changes in the latest 1.3.1 release, including the elimination of browser sniffing and speed improvements. While I am a regular user of jQuery and I find it useful, I am not an evangelist proclaiming it’s glory. It has problems, and I am often frustrated by approaches taken by the core development team, most recently in a thread on the jQuery Dev group called IE6 feature detection – possible solution.

Then last week, David Mark – a regular contributor to comp.lang.javascript and someone with a lot of javascript knowledge – started a thread called jQuery’s latest stab at competence.

He raises some good technical criticisms of jQuery, and the thread goes on quite long. I voice my opinion as well (we have often clashed in the past on the use of jQuery). For someone who is interested in a deeper understanding of the design of jQuery, some of its technical faults, and a look into whether it’s actually a library that should be recommended, I would recommend reading through these two threads.

8 Comments

  1. brafferty says

    Matt, as a developer who has recently been incorporating jQuery into sites, I read that thread with growing apprehension. David Mark’s vehemence was compelling. As some mentioned in the thread, users of these libraries seek features that might not otherwise be possible given work load and time constraints. In your experience, are any of the popular libraries “safe” to use. YUI perhaps? I spent time reviewing ExtJs recently, but it seemed rank overkill for DOM manipulation and light UI tweaking. Your advice in this area would be greatly appreciated. Thanks.

  2. Matt says

    All libraries come with a trade-off. I’ve only used jQuery extensively, but I have some knowledge and experience with others.

    YUI is robust, if not verbose. It has some very smart people on it, but it hasn’t seemed to catch on as much as jQuery. When I looked at it, it felt “heavy” to me. And there are some dubious coding practices in it as well. Prototype is a beast that has been around for a long time and not one I would recommend. But it does have a lot of OO support, if that’s what you’re looking for. IMO, javascript is not OO, so I have never liked trying to force it to be. ExtJS is very slick and fancy, but it’s HUGE bloat. I don’t know what the code looks like. I do know it was going to be ported to use jQuery, but I don’t know if that happened. MooTools is a hacker’s library, and IMO it just doesn’t offer anything that jQuery doesn’t. Dojo is dead, AFAIK. I never liked it.

    So, my favorite is jQuery. It has problems, and it’s far from perfect. Plugins can be hit-or-miss. The UI framework seems to be starting to come out of its infancy, but it’s still a bit too bloated for my use. I use parts of jQuery and avoid some other parts. I write most of my own plugins, and I still write a lot of “pure” non-jQuery javascript. I find that as I being to optimize a chunk of jQuery code for performance and to generalize it, the process slowly starts to filter out the jQuery! So I use jQuery to get quick things done and for convenience when I know it will work as expected, and for complex things I end up writing pure js (and saving it for reuse). In the most difficult situations, no framework will work well, IMO.

  3. brafferty says

    Matt, thanks for the response. I feel more assured about using jQuery — I tend to avoid the plugins since their quality can be hit-or-miss — and for what I need the base package is probably sufficient.

  4. Matt says

    Peter – Thanks for the comments. I would encourage everyone to evaluate all the frameworks that they can in order to find out what works best for them.

    My “Dojo is dead” comment wasn’t referring to the development of the lib itself, but in terms of market usage. From my perspective, in the projects and web sites I work with, I don’t see Dojo anymore. In fact, I see it actively removed and replaced by other solutions. It’s trending downwards, in my experience. I don’t remember the version I last looked at, but when I did it was very large and overwhelming. It had become a huge toolkit with images and everything included in the release – much like a full jQuery UI release and more. This is not the way I like to see JS development done, and not an approach I recommend to others. But if it works for you or anyone else, then more power to you. There’s more than one way to get the job done :)

  5. Matt says

    OOPS – I accidently deleted Peter’s comment that I just replied to! Here it is:

    Your “Dojo is dead” remark seems unjustified. Dojo is very much alive and well, and is currently planning to release 1.3.0 … The 500k line code base (which covers Dojo, Dijit (UI), and DojoX) is maintained actively by a large group of fun and incredibly brilliant developers (pictured here: http://demos.dojotoolkit.org/demos/skew/ )

    1.3.0 marks the 4th major release in 2 years, not including the 5 dot-releases in between (which typically are updated translations for the internationalization that comes out of the box with Dojo, or critical backwards-compat fixes).

    Perhaps your statement was based on experience with a pre-1.0 version, like Dojo 0.4.3 — I wasn’t very fond of that one myself. I urge you to re-evaluate Dojo, if for no other reason than to re-affirm your dislike (though be fair, a lot has changed in 2 years) . The “base” API’s can be seen at: http://dante.dojotoolkit.org/plugd/plugd/resources/api.html though a few of those API’s are unique to “plugd”, a fun mini library I built on top of Base Dojo: http://code.google.com/p/plugd/ – which is very jQueryish in nature.

    Feel free to ping off-list if I can answer any questions you might have directly.

    Regards,
    Peter Higgins

  6. phiggins says

    Matt,

    Dojo Base is still just a single file download: http://download.dojotoolkit.org/release-1.3.0rc2/dojo.js (or for fun, the enhanced ‘plugd’ version: http://plugd.googlecode.com/files/dojo-1.3.0-plugd.js )

    The rest is entirely optional. Imagine plugins, with a unified API and style/documentation guidelines, conveniently available on the CDNs. Dojo is a toolkit, not a “framework”.

    Regards,
    Peter

  7. rickmyers says

    Hi Matt,

    I’ve been a fan of your site for some time, even back with the old style site when you had 10 tips for being a better JS programmer. I’ve referred many people to your site over the years (the fact you no longer have the 10 tips up saddens me).

    Anyways, you used to make a point of telling people to skip prototype, and I can’t agree more. I was there in the beginning when prototype tended to break “stuff”, and debugging a site with prototype in it was near impossible. I guess it has improved as I don’t see you trying to dissuade anyone from it anymore. If Dojo isn’t dead, it should be. I’ve pulled that thing out of two different websites and they ran so much better with out it.

    But Matt, I’d like you to take a look at something I’ve been working on for the last year. I’ve rejected the bloated frameworks, and been working on something very very different. Take a minute please and tell me what you think… In this case, it combines social networking with some cloud-computing elements:

    http://www.cloud-it.com
    http://www.cloud-it.com/index.php?who=Rick%20Myers
    http://www.cloud-it.com/index.php?who=Sample

    But the technology is meant to be simple, easy, and portable…

    http://www.cloud-it.com/technology/

    Best Regards,

    -Rick Myers
    I’d be interested in hearing your opinion, even if you think I’m wasting my time :-D

  8. rickmyers says

    Whoops, found your javascript toolbox, and it still has the 14 tips… Sorry about that! :-D