Mooving to jQuery

Tagged: Javascript, Web Development

JavaScript frameworks are a godsend. Before we had the likes of Prototype, MooTools and jQuery doing anything in JavaScript was tedious and painstaking. So tedious and painstaking that unless it wasn't anything more complicated than hiding an element I probably wouldn't have bothered.

Then along came the frameworks, no longer did we have to check what browser and version the user was running, we could just code once and be happy forever. Well, almost. Even today when adding options to a select box I still have to wrap a non IE friendly statement in a try block to make it cross platform. But, still, it's a massive improvement.

For no reason other than it was the first framework I really stumbled upon, I've been using MooTools since version 1.something, and it's awesome. The abstraction for cross browser compatibility aside, it's got a a load of functions that make doing fairly complicated effects, ajax calls and UI improvements a piece of cake. It also had also built on ProtoType's OOP style inheritance into something that appealed to me coming from that background. Which brings me to jQuery.

I had obviously heard of jQuery and it always seemed the more popular sibling to the unappreciated MooTools, but every time I though about turning to the dark side I wasn't convinced. I'd have a cursory glance at the API and seeing that it still wasn't based on 'classes' like MooTools, I'd turn away in disgust. Now of course there's nothing that MooTools can do that jQuery can't and it does really come down to personal preference in terms of what style you prefer. Yes one framework may be faster for certain operations, but we're talking slight differences and I imagine they're all much of a muchness overall.

However we have decided that from now on all future projects are going to use jQuery as the framework of choice. Why did we decide to do this now? Aside from nasty conflicts with ASP.net web forms JS library (which I don't blame the contributors of MooTools for, but then equally they aren't doing themselves any favours by refusing to look at it currently), I think the weight of community support and speed of development releases has finally shifted the balance to such an extent that jQuery is now the only sensible option. A quick completely non-scientific example.; searching StackOverflow for "mootools" gives you 2,860 results, "jQuery" brings back 112,207. Now I know that's just one source and it's not exhaustive, but still it's a large difference. Which framework am I going to get more help on when I need some pointers, or which framework will I be able to easily get some UI components to use in my next web app?

So for these reasons we're giving MooTools the hoof, it's a shame really as I much prefer its class based API and layout. Now looking forward to learning a whole new framework and all the fun that entails!

Add a comment