May 17

I hate Javascript. It’s a necessary evil, but it’s hard to read, hard to debug, and has a tendency to not work for seemingly unpredictable reasons. I all but abandoned Javascript for a brief period a couple of years ago (when it was still possible to build a website without it) instead using server-side solutions where, in all honestly, I should have used Javascript. That was, as you would expect, utterly unsustainable and soon after what we know as Web 2.0 forced me back into the hateful world of Javascript.

So, when I stumbled upon the script.aculo.us library, I was curious to see if it would truly simplify the incorporation of Javascript into web pages. You can imagine my glee when, in a matter of a few minutes, I had built a page with some simple, yet impressive, display effects. Script.aculo.us delivered on its promise. But, what exactly is it?

Most simply, it is a library of Javascripts that provide cross-browser functionality for animations, AJAX, DOM manipulations, etc. There are other script libraries, but what I like about this one is how easy it is to call these functions. Even more amazing is the fact that they work as expected on the first try. Of course, all of the heavy lifting is done for you, including the programming and testing, so you’d expect it to be straightforward in its implementation. Still, I’ve tried a number of tools intended to make Javascript easier and, more often than not, things are only made more complex.

The library is built upon the Prototype framework. This framework is, itself, a pre-programming of scripts needed to perform most of the fundamental actions in AJAX web applications. It extends the DOM by adding a number of methods to elements and objects. It uses JSON, an alternative to XML for transmitting data to and from web applications. It all combines to allow a developer to easily create new classes of Javascript functionality. Thus, the folks at script.aculo.us created the classes that power the animations and other interface tricks that have become ubiquitous on web applications.

The only issues I have found with script.aculo.us thus far is its pathetic documentation. The wiki that is supposed to provide documentation is under perpetual construction. There is a ’static snapshot’ of the wiki in its previous state, but its vanilla HTML doesn’t allow for examples within the documentation itself. The state of the documentation can make using the library a challenge if you are not savvy enough in Javascript to glean usage from the code itself. The good news is that both Prototype and script.aculo.us are popular enough to have spawned a book from the Pragmatic Programmer, written by Christophe Porteneuve, among others.

In conclusion, script.aculo.us is a brilliant tool for quickly building Web 2.0 interfaces, so long as you can figure out how to use it.

Next Entries »