The list I'm referring to is that of fantastic JavaScript frameworks. My list now includes Prototype (and the fact that I didn't need to look up the URL just shows how many times I've recommended Prototoype), Dojo Toolkit, script.aculo.us and now MooTools.
I've not had the time to play around with MooTools yet, but simply looking at the help page you can't deny that it looks sweet.
"OK" you may say to yourself, "it doesn't look like there is anything too new in there". Well even if it were just the really nice syntax changes, such as when extending classes:
-
var Mammal = Animal.extend({
-
initialize: function(){
-
...
-
}
-
});
Which is a lot more intuitive and concise than the current method offered in Prototype:
-
var Mammal = Class.create();
-
Object.extend(Object.extend(Mammal.prototype, Animal.prototype), {
-
initialize: function(){
-
...
-
}
-
});
I'd be happy to recommend MooTools on those improvements alone, intuitive and concise is always the best combination when it comes to programming languages as far as I'm concerned, but there is much more:
- OO inheritance, allowing you to call methods on the parent object when extending objects.
- Using the $ function to extend elements with the Element methods.
- Defining custom methods on elements.
- Powerful yet simple effects.
- The full release (when the compressed option is chosen) is around 20kb, consider that the latest version of Prototype alone is 53kb and when compressed (with the fabulous Dojo Rhino compressor) is still 36kb. To work around the large size of Prorotype & script.aculo.us combined I've had to break Prototype up into its component parts and then use a custom manager for managing script requirements (I plan to post about this in future once I've worked up a couple of examples); I mean who uses all the functionality Prototype offers at the same time?
Another of the potentially great things about the MooTools library is the FX themselves, I'm aware that Moo.fx has been around for a while, but the really great thing about Moo and is that it doesn't seem to try and do all the work for you. If you've ever taken a look at using the script.aculo.us dragables or sortables for anything that slightly differs from the test cases or examples you'll soon come a bit of a cropper, Johnathan Snook gives a good example of the simplicity and flexibility of the MooTools way of doing things in his post exploring drag and drop with MooTools.
I'm sure I'll have more to post about MooTools in the near future as I'm planning to use it as my primary JavaScript framework for my next large project, so we'll see if it lives up to expectations. For now I'll just share a few links that I've found informative so far:
Comments
There have been 10 comments so far, join the discussion.
1. Martin - 18th Sep 2006 - 9:22 am
I’ve been using moo.fx for projects where script.aculo.us is too heavy (IE government websites with a 40K limit for all HTML/CSS/JS/images). I have to say I prefer the syntax to the script.aculo.us one. I didn’t know about mootools but from your post and the quick scan through their help page, it looks perfect. I’m definitely gonna keep an eye on this one. And after the script.aculo.us home page redesign, can we really trust them? ;)
2. Dave - 18th Sep 2006 - 7:55 pm
Martin:
A 40K limit for everything, that sounds like a challenge – I hope that’s after gzip compression and not before.
As for script.aculo.us, exactly the mootools (I’m not sure yet if it should be all lowercase or not) website does things right; granted it’s not got much information on there at the moment, but so far it’s very easy to digest and is holding back on the blockbuster effects.
3. Alister Cameron - 27th Sep 2006 - 1:40 pm
I started with Prototype/Scriptaculous, then decided it was too heavy and I rarely needed to use anything like it’s “full” power. So I switched to moo. But then I realised, as good as it is, that there really isn’t much of a dev community around it. Mootools and other thingy the mad4milk guys are doing may change that, but…
Then I found jQuery. And I am sold. It’s very very smart, it’s well supported by a lot of active devs, it’s well documented (no really!) and I got my head around it in very little time, which is saying something, given that I’m more a designers than a programmer.
Again, like moo, there is a lack of mature plugins out there, but I am confident that will change.
The BIG frustration I have at this moment, is that I am using your cropper tool (which is BRILLIANT!) on a page with jQuery, and – no surprise – they’re not happy together.
So I am trying to fond a JS guru to recode your cropper for jQuery.
I will be interested to see how much less code it takes, which is what usually happens in a “jquery conversion”.
Cheers,
– Alister
4. Alister Cameron - 27th Sep 2006 - 1:43 pm
Sorry, one more thing…
Drupal have chosen jQuery as their default JS framework, and I think it’s to be included in the base install from the next version onwards. That’s a BIG endorsement right there!
– Alister
5. Dave - 27th Sep 2006 - 9:46 pm
Alistar:
I did look take a fleeting look at jQuery a few months back but didn’t look into it much to be honest.
I’ve only just started really playing around with mootools, I hadn’t used it when I made this post, and I’m still really impressed with it. There are a have only been a couple of things that bother me so far so I think I’m going to continue working with it for now.
As for the cropper, its great that you like it, I was actually thinking of re-working it to work with mootools as I think it would really benefit from the improved object inheritance model that mootools offers. I may also look at a jQuery conversion if I get some spare time (so that’s probably not going to happen then) just to try out all the available caps to see which fits best.
6. Dave - 27th Sep 2006 - 9:47 pm
Alister:
Sorry for spelling your name wrong in that last comment, I noticed it the second I let go of the mouse button when I clicked the submit button.
7. Will - 13th Oct 2006 - 7:14 am
I love the cropper and a few months back I integrated it into a project I’m still working on. Since mootools came out though, I have migrated the code to use it instead of protaculous and really the cropper is the only thing dependent on it. If you ported it to moo I’m sure more than a few developers would be happy.
8. Joshua Sierles - 7th May 2007 - 10:45 am
Hey – was this ever ported to mootools? If not, I’d like to start doing a port.
9. Jesse - 1st Dec 2007 - 11:02 pm
Thanks for the post, any updates on the mootools port of the cropper? I’ll help out any way I can.
10. Dave - 1st Dec 2007 - 11:06 pm
Jesse:
I’ve not had time to look at porting the cropper to mootools as of yet, and I’m currently pretty deep in a separate project, which I’ve mentioned a few times, so I don’t know when I’ll get time to look at the cropper. However if you want to work on a port together I’ll be able to give some time to that, a couple of evenings should see it ported successfully and hopefully give me some impetus to fix the outstanding bugs.
Let me know what you think.
Leave a comment
No HTML please, only textile. For code please use [lang]...[/lang] tags (e.g. [html]...[/html] for HTML)