views:

125

answers:

4

I have a date picker library written for MooTools that I want to port to Prototype. It's looking to be a long arduous task and I'm wondering if anyone has seen or written guides on the differences between the two. A translation dictionary of sorts, where I can look up a Moo function and see the prototype equivalent, or vise-versa.

The same would also be nice for jQuery to Prototype.

+2  A: 

I'll take a stab at this. If you haven't found any resources after a thorough google search, I'd say you're stuck with just opening up the API's of each and just consulting them back and forth and looking at the examples.

I'm actually going from Prototype to jQuery on a project right now. (Aside: I'm much happier with jQuery having used both for awhile.) My basic work flow is just referencing the API as needed.

I would be surprised if there was such a mapping of one to the other though. In either framework, there are many ways of doing any given task, and on top of that they work in different and important ways. Sure there's some 1:1 correspondence like "addClass" vs. "addClassName", but jQuery DOM manipulation typically works on sets of elements (which may be just a set of 1) while Prototype works on single elements (which may be wrapped by an each statement to work with sets).

Fortunately, both have pretty good and easy to use/reference API's.

Good luck.

Keith Bentrup
+1  A: 

As mentioned by Keith, there is no a 1:1 correspondance between the features provided by libraries.

Even more importantly: different frameworks require different mindsets. It's very little about renaming functions, it's more about writing the code in the style of another framework. Thinking like "What would be the jQuery way of doing this?"

If you're porting code from framework A to B and don't know B very well, you can easily end up with with something quite ugly.

Rene Saarsoo
A: 

I can't think of any guides on converting. But there have been a few Library1 versus Library2 blog posts where libraries are compared and contrasted. Probably worth hunting those down and reading them.

Nosredna
+1  A: 

I've wanted to find something like this for a while. It got so I wanted to make my own and a few weeks ago I started ArtLung Rosetta, an effort to have a "Hello World" page with various techniques in many major libraries. It's a work in progress.

However, a few weeks ago I came across this EXCELLENT resource by Matthias Schütz. The JavaScript Library Comparison Matrix. That reference site has syntax comparisons with links to relevant documentation for: DOM Ready, DOM Basics, DOM Filtering, DOM Manipulation, Effects, Transitions, Events, Custom Functions, Ajax, and Classes.

I enjoy comparing the various libraries approaches -- I find I learn a great deal about the libraries themselves, and my own programming style and how I can improve it by carrying out the same task in multiple frameworks.

artlung
This is a great site. Not exactly what I was looking for, but pretty close. Thanks!
ChiperSoft