PPL30 Day 21: Low Pro

Continuing the Javascript theme for the weekend, today I sat briefly with Low Pro, a library that began its life as a set of enhancements to Prototype.js.

This is part of the Peer Pressure Learning 30 series. To learn more about what in the hell that means, see the intro to the series, A Good Time To Learn.

Resources

Dan Webb’s Web Site

Dan Webb is the creator of Low Pro. You can find out a lot by simply skimming the articles about Low Pro on his website. In fact, that is where I spent most of my time at the end of this Sunday night.

Low Pro for jQuery on GitHub

Though Low Pro was originally intended to be enhancements for Prototype.js, there is a jQuery version as well. It ports Prototype’s Class.create to jQuery. Awesome!

What I Think I Now Know

In 2006, Dan Webb created Low Pro to enhance event handling and DOM manipulation in Prototype.js (both of which are welcome). I recommend reading through the original post in September 2006 to see some of the additions. Reading through these, I wondered why I hadn’t been using this on the large Prototype.js application on which I worked previously. In particular, the DOM building stuff would’ve made my life much easier in several instances – instances which are memorable for the amount of pain I went through using Prototype’s building methods.

There is, as mentioned, also a Low Pro version for jQuery. jQuery has some Low Pro-like behavior already implemented. The primary gains from using Low Pro for jQuery are behavior classes:

<% coderay(:lang => :javascript, :line_numbers => :inline) do -%> Testy = $.klass({ initialize: function(arg) { alert(‘ive just been attached with the arg ‘ + arg); }, onclick: function() { alert(‘ive been clicked’); } }); // Stolen from the low-pro-for-jquery README on GitHub <% end -%>

… and the fact that $.klass is a full port of Prototype’s Class.create! That is a feature definitely absent from jQuery today. I think adding Low Pro to your jQuery project is worth it for that OO goodness alone.

The source for Low Pro for jQuery is quite small. I recommend giving it a quick skim, as well.

Unfortunately, I don’t have much in the way of true commentary on this today. I will, however, be adding it to a project that will be receiving a lot of attention. Hopefully I’ll really get to put it through its paces at that point.

In other words, ask me later!