Sunday, September 7, 2008

JQuery vs. MochiKit

I could go off on a rant here about how MochiKit "used to be cool man, but now they're not". I won't, because I've already done that elsewhere, and it's not exactly very productive. So what I will say is this: MochiKit has a lot of clever ideas, including a few really clever ideas, that most of the other Javascript frameworks don't. But its creator and primary contributors take the "if it ain't broke, don't fix it" philosophy to the extreme, and as a result the "active development community" responsible for the framework is anything but.

Because of this, I've come to the conclusion that tying your project's fate to MochiKit is like investing all your money at the turn of the century in horse carriage manufacturing: fine if your choice only matters in the near future, but in the long term that newfangled "horseless carraige" technology will make you wish you'd invested in automobiles. As a result, I'm now in the process of migrating both my personal projects and the website of the company I work for from MochiKit to JQuery.

Now the first and most obvious problems of doing this are the "you say tomatoe, I say tomatow" issues: each framework has its own name for various functionality they share. On top of that there's the differences in approach of the two frameworks, the most significant being that while everything in MochiKit is a function, almost everything in JQuery is a method. This makes a huge difference in how, say, event handling is done. And then beyond all that there are the things that JQuery just flat out doesn't have that MochiKit does, which I have to try and liberate from MochiKit without taking half a library of dependencies with it.

So, the next few blogs will chronicle this whole transition, both my thoughts on doing it and what I learn about both frameworks while doing it. And at the end, perhaps I'll even have some sort of "the best parts of MochiKit as a JQuery plug-in" to share with the world. Who knows?

No comments: