Is jQuery The Best Option For Large-Scale App Development?

March 6, 2011


This post is directed at jQuery users interested in building large applications. Quite often, when you discuss the options that are available for developing large-scale JavaScript applications, you may wonder whether toolkits such as dojo may be more appropriate to use than jQuery. There are of course others, however this post will be focusing on dojo specifically given it's level of comprehensiveness. I'll try to address this at as high a level as possible to avoid too detailed a feature comparison.

It's important that you don't fall into the trap of thinking that just because jQuery is what you know best, it's what you should always use because that would be untrue. The reality is that 'what you use' completely depends upon the type of problems your project is attempting to solve as well as your current level of skill.

jQuery is your best option if your project primarily requires a level of DOM manipulation, easier access to Ajax (both dojo and jQuery support deferrers), animation effects, hooks or events. It's also highly popular, so if your company's dev team are attempting to hire, you *may* find that there are more developers with jQuery knowledge available than those specialising in dojo. This is a moot point however given that dojo developers (generally) tend to be more experienced with the many non-trivial challenges involved in truly large-scale application development and (in my opinion) would be able to quicker pick up jQuery if needed than a jQuery dev may pick up dojo.

It's worth noting however that jQuery is a library whilst dojo is more of an intensive, enterprise-level toolkit so there's certainly more there to learn. dojo offers better solutions for OOP (and other patterns for code organisation), custom modules, internationalization, templated widgets, grids, charting, the ability to be used in non-browser environments and integration with other frameworks like Zend but it also better suited when you're developing web applications that are significantly complex.

I would argue that jQuery has a slightly better level of documentation available and so, unless you've been heavily using JS for some time, you may experience a slightly higher learning curve when checking out dojo for the first time. This may be one area where you might find professional training useful, however there are plenty of dojo devs out there that picked up how to use it on their own.

I think that if you have an appreciation for the need to structure client-side JavaScript code correctly, have decent build and dependancy management tools in place, you could easily use either of the options above, but it's important to always keep in mind that there *is* a point where it stops making sense to roll your own large-scale development kit using jQuery and just opt for dojo instead.

I'm not advocating that if you currently use jQuery you should drop it and go straight into using dojo, but rather that you keep yourself open to performing due-diligence before beginning a large project using either.

As some of my colleagues in the JavaScript community have pointed out before, this can save you both time and a significant amount of financial investment so just be sure to evaluate both options if you're developing anything significantly non-trivial.

Hopefully that's a balanced view that can be endorsed by both jQuery and dojo camps. I'd be interested in hearing any contrasting opinions on this as I know that there are some quite strong opinions on both sides.