Second System Syndrome 2.0

Set out to look for a ready made grid to import information from a spread sheet. The nicest one that I came across, via the Rails Spinoffs mailing list was A Grid Component for Yahoo! UI - Part 1, the work of a fella named Jack Slocum. This introduced me to the Yahoo! UI Library, or rather, made me take notice.

I’ve just completed a real deal Prototype/Script.aculo.us application, for the neighborhood boundary project at Think New Orleans.

Prototype and Script.aculo.us are well documented, and there is enough mention of quirks between the Google Maps API and Rails Spinoffs mailing lists, that I’ve been able to navigate the incompatibilites between Protoype and Google Maps.

The Yahoo! UI Library contains parallels to the Prototype library, such as effects and event handling structures. What caught my eye, was the Ajax implementation’s acceptance of a structure of event handlers, much like in Prototype, with the addition of a field for the target of the event handlers. Assuming that this pattern is repeated elsewhere, this is more economical than saying:

this.onMouseOver.bindAsEventListener(this)

When that is repeated for every mouse action, it seems tedious. This may have more to do with my preference for short lines than any rational complaint.

One nice concept, shows that people are somewhere thinking about the lessons learned from Prototype, and other libraries that I’m not as familiar with, like Dojo. The code Jack created for his grid is crisp.

The crisp code and straight creases makes me think of Borland’s Object Windows Library, which was where I entered the world of UI programming, many years ago.

It also makes me think of Second System Syndrome, first diagnosed by Fred Brooks in the Mythical Man Month. The Yahoo! UI Library adds more structure to Prototype and Script.aculo.us, creating a library with more rigor.

In Jack’s blog he references a Zebra Table Showdown over at a blog about jQuery. Although he goes on to show that with his extension library, the Yahoo! UI Library can be just as terse, I’m already drawn to the jQuery library.

jQuery has the feel of scripting, where the Yahoo! UI Library has the feel of the Object Windows Library.

The former uses the document itself as part of the model. In Prototype derived code, the trick where you bind the “this” object to an object of your choice, is used to create a controller. This is a step just far enough away from the Document Object Model to organize one’s thoughts, but not so far away that you interact with the browser’s document as if it were a sofa-surfing paradigm that stayed longer than the weekend it promised.

jQuery makes it easier to navigate the browser’s document, and therefore, makes applications a matter of knitting together document nodes with events. That’s a fresh new look for this generation of JavaScript programmers, or a return to the practices of the days of yore. Not a second system effect.

Leave a Reply