Hacker News new | ask | show | jobs
by tizoc 5309 days ago
Dojo is extremely modular (unlike jQuery which is has a pretty big monolithic core and overloads $ for almost everything).

If what you have to do is manipulate the DOM and do XMLHttpRequests, then jQuery is more than good enough, otherwise Dojo has a lot to offer.

Some features from Dojo which are not about DOM manipulation or XMLHttpRequests that I use a lot:

- AMD-style modules (you can have this with jQuery, but Dojo is built with AMD from the ground up) http://livedocs.dojotoolkit.org/loader/amd

- the build system http://livedocs.dojotoolkit.org/build/index

- object stores http://livedocs.dojotoolkit.org/dojo/index#store-dojo-store

- deferreds (jQuery has these now) http://livedocs.dojotoolkit.org/dojo/Deferred

- templated widget definitions http://livedocs.dojotoolkit.org/dijit/_TemplatedMixin

- publish/subscribe http://livedocs.dojotoolkit.org/dojo/publish

- observable attributes http://livedocs.dojotoolkit.org/dojo/Stateful

This doesn't mean that you should be using it, just use what feels better for you. For some people (like me), Dojo is what feels better.

1 comments

That modularity is nice in theory, but Dojo gives me 170kb of compressed javascript simply for selecting the fileuploader widget. I saw the same for Google Closure Library by the way - not saying I could write an all purpose js library which would score better.
That's one of the major things that 1.7 fixes and 1.8 will fix even further... smaller modules and finer-grained dependencies so you aren't pulling in nearly as much base code for each feature.