Over the last few weeks I’ve been checking out various JavaScript frameworks for use in a site I’m building at work. There are a number of frameworks out there, from Prototype, which I previously used to do some AJAX stuff on WipEoutZone, to JQuery, the wonderfully named MooTools, and Yahoo!’s own Yahoo! User Interface Library.
Most of them aim to provide shorthand ways of accessing DOM elements and handy methods that take the pain out of getting a JavaScript app up and running. Well, that’s the plan, anyway. Some do certain things better than others – MooTools is tops for fancy effects, while Prototype is good for grunt work. YUI seems a bit limited in its scope, although the documentation is pretty good and has a good number of working examples. JQuery looks to offer a more compact way of getting results that take more work with Prototype, although it’s the one I’ve looked at the least.
Despite the fact I’ve used it before and gotten some simple things working with it pretty swiftly, Prototype has excruciatingly sparse documentation, which makes getting a working example of almost anything a pain in the ass. Even worse is that the online documentation isn’t searchable – seriously, what the hell use is online documentation that isn’t searchable? Even if you do find what you’re looking for there is rarely any sample code to give you something to go on, so attempting most things is a bit of a shot in the dark.
It looks like I’m going to have to take a good look at JQuery when the dust settles with what I’m doing right now. The funny thing is that in the end it probably wont come down to me choosing the “best” framework (heck, maybe they’re all the same under the hood) – it’ll come down to using which one has the best documentation.
Well, today I spent some time reading the documentation for JQuery and it was very good indeed in comparison to the others. Using JQuery I managed to refactor some Prototype based code I’d written and, although it wasn’t as plain sailing as I’d hoped, I managed to get the same results with less code in the end. Might as well take that new ball and run with it now. 🙂