Tuesday, October 27, 2009

Pro JavaScript - Libraries

By: Michael Kimsal | Posted: Oct 23rd, 2009

Pro JavaScript - Libraries

JavaScript has seen a resurgence in popularity in the last five years.  What was once almost written off in the early 2000s is now a hot skill to have for any web developer.  The landscape has changed a lot over those years, and JavaScript developers have a number of options at their disposal to make development much much easier.

Popular Libraries


Let's face it - writing a bunch of code by hand stinks.  It's time consuming, error prone, and you're often stuck trying to figure out basic problems and making sure things work the same across all the major browsers.  A number of libraries and frameworks have sprung up over the last few years to help ease the pain, and let you focus more on your business logic rather than the plumbing.

jQuery
jQuery is one of the most popular, because it's intended to be lightweight and easy to integrate in to existing projects.  Often with just a couple of lines of code you can achieve some pretty impressive animation and fading effects - perfect for adding that "web 2.0" touch to your website.

YUI
This toolkit from Yahoo! is another popular choice for developers, not least because the weight of Yahoo! is behind it.  This is the code they use on their own sites, and it's been tested, tested and tested some more to ensure a good experience on all the major browsers.  Their documentation is solid, and the community is strong, although not as large as jQuery's.  The biggest drawback to YUI may be its verbosity - it often takes 3 or 4 lines of code to accomplish what jQuery can do in 1 or 2.

Dojo
Dojo is another one with large corporate support - IBM has developers working on and contributing to Dojo, and they use Dojo in some of their own web products.  Like YUI, it's been a victim of verbosity, but also like YUI, Dojo's aims are larger than those of jQuery.  Dojo is one of the few major toolkits to offer internationalization support, for instance.  If you have a major web project, you owe it to yourself to consider Dojo, but prepare for a steep learning curve.

MooTools, Prototype, ExtJS, mochikit, ZK and others are also candidates to consider, although all tend to have smaller communities than the first three listed above.  As new contenders fill various voids in the library space this will undoubtedly become a more crowded market.

More information can be found by visiting the various framework sites, or by visiting http://jsmag.com.

About the Author:

Michael Kimsal publishes resources for web developers, including JSMag for JavaScript professionals, and GroovyMag, for Groovy and Grails developers.

 

No comments: