9.02.2009

JQuery vs. Prototype

Well thank you Michael for my first comment. Michael Minella had posted this article in response to a comment I made about telling Prototype I was never coming home after being with JQuery. I thought Glenn made a nice fair argument that Prototype is NOT dead and JQuery isn't such a god send that we should never look at it again.

I'm still not coming home.

Without going into specific differences between the two (I think there are plenty of articles on that), what I personally enjoyed about JQuery was the almost configuration based approach to instrumenting events on the DOM elements, thus keeping all of the JavaScript in one place. Sure I learned after the fact that you can do it in Prototype too but JQuery kinda prescribes it with the $(document).ready() function. So I thank JQuery for opening my eyes to this style of instrumenting DOM elements.

Many people seem to use performance in this debate. I never noticed Prototype to be "slow" unless benchmarked against JQuery (slickspeed). But 1ms vs. 6ms? Come on it's the web! Where else do developers get so say to hell with shaving milliseconds? Most of my performance concern is server side where you are saving seconds or preventing a complete meltdown during peak hours. Sure if I were building an ACID compliant DB in JavaScript I might profile my JavaScript it but for making a <div> wiggle, the differnce in imprecivable. So any points about JQuery performance hold little water with me.

If performance were the primary concern, I would have prefered Dojo over Prototype. I'm sure Dojo's excellent in its own ways but the syntax always felt more geared towards developers instead of designers . When I'm knee deep in content, I prefer to keep my designer hat on. JQuery and Prototype/Scriptaculous both seem to keep me in my happy place, which is especially necessary for me when doing any front end development.

When it comes down to it, the tangible reason I now prefer JQuery was its suggestion that one should instrument elements in the ready() function, which in turn keeps event based function calls out of the HTML. That little trick was enough to make me really enjoy JQuery and I haven’t missed anything that would make me come home. Honestly, I wouldn't mind using either or at this point. They really are pretty similar as far as what you can get done and community support, even though JQuery seems to have the momentum at this stage in the game.

So, I’m sorry Prototype. I’ll never forget the awesome times we shared . Should we meet again, don’t be surprised if I pull out some tricks I learned while away.

No comments:

Post a Comment