Friday, 8 March 2013

Dojo vs jQuery Mobile: Quick Comparison

Both jQuery and DOJO are JavaScript Development Frameworks/Packages that provide functions to make the writing of JavaScript code easier, faster and more efficient. jQuery normalize things across browsers and serves as a great way of doing DOM manipulation. Dojo is a more on comprehensive toolkit which helps developers to build superior desktop and mobile web experiences.

Advantages of jQuery:
  • Fast
  • Well documented
  • Easy to use
  • Chaining
  • Easy-to-use Ajax
  • Nice event handlers
  • CSS selectors
  • Small (only 30 KB)
  • Nice little built-in effects.
  • Plugins
Advantages of Dojo:
  • OOP (and other paradigms).
  • Widget infrastructure.
  • Modules done right with all necessary goodies:
    • Lazy loading of modules dynamically.
    • Asynchronous loading of modules if desired.
    • Simple integration with CDNs (content delivery networks) for heavy-duty web applications.
  • Sheer breadth of available modules in DojoX including graphics, charting, grids, and so on.
  • Attention to details in widgets:
    • Support for i18n (including LTR and RTL languages),
    • Support for l10n (including standard date, currency, number formatting),
    • Provisions for people with special needs (automatic high-contrast mode, keyboard-only support, and so on).
Deciding right tool for a project depends a lot on complexity of the application, scalability, DB/Web Service dependencies, current skill set, etc. jQuery offers little guidance on how to structure your codebase, how to ensure that everything you need is loaded, or how to build your code into production-ready files. Dojo really shines here, but again, it takes a bit of getting used to.

Personally, I think Dojo's lack of good documentation/reference code, lack of 'marketing', and relative complexity keep it from becoming popular. Documentation is a whole lot harder to use than jQuery’s because, at first glance, it’s quite a bit more scattered and substantially more API-based than task-based. It's much easier to get started with library like jQuery because of all these factors. However, once you get over that initial steep learning curve, Dojo is good!

References