Page 1 of 1
Mootools vs Prototype vs jQuery vs ?
Posted: Thu Jan 25, 2007 1:47 pm
by Christopher
I just wondered what people thought about the direction that Javascript libraries are taking. I have read that Mootools tries to combine the ideas of both Prototype and jQuery. I have used both of them and though I like them, I often think they are a bit too much as far as forcing you to do things their way rather than just coding straight Javascript -- which I have come to find simpler in many cases.
I know Kieran wants to marry jQuery, but are there any users of Mootools or other libs?
Posted: Thu Jan 25, 2007 1:55 pm
by feyd
Honestly, I've avoided them for the most part.
I haven't been able to justify the requirement of Javascript yet, let alone Ajaxed up stuff. I have no problem having them around, just not as the only means of using the site.. so I haven't even really gotten to the point of incorporating any libraries as yet.
Posted: Thu Jan 25, 2007 2:11 pm
by Burrito
I don't use any either. I prefer to use all of my own stuff, not because my sites don't 'require' js (most do), but because I'm too lazy to spend the time learning a new library. I've already paid my dues learning JS, might as well put it to use...
Posted: Thu Jan 25, 2007 2:33 pm
by Kieran Huggins
I was a purist as well until a couple of weeks ago... but honestly, jQuery really does save time and hassle. I like it's simple "find things and do stuff" philosophy, and it's only there if you summon it with $()... the rest of your code is untouched. It even plays well with other libraries.. what more could you ask for?
Posted: Thu Jan 25, 2007 3:34 pm
by Christopher
Prototype is nicely OO and yet jQuery is like XPath for Javascript on steroids. I have just been reading about Mootools recently. It is based on moofx which used Prototype, but it seems like Mootools has removed Prototype and headed in a jQuery direction. I just wondered if anyone had used it.
I have had both good and bad experiences with both using Javascript libraries when I later wished I hadn't and custom coding when I later wished I had used a library -- mainly because it would have taken too long to code desired additions that would have been simple with a library.
I am definitely in the pro-javascript camp and have no problem requiring it, nor have I ever had a problem when it was required. I like the idea of pushing view and controller stuff into the client and have had good success with it.
Posted: Sat Jan 27, 2007 12:25 pm
by Ambush Commander
That's strange, it seems that jQuery has borrowed some code from Mootools...
I'm currently using jQuery and my greatest problem with it are that you can't stop an animation in midstream. I think mootools.fx has a much more full-featured effects library. I'm also not too happy about jQuery's documentation, it's very half-baked in some places. I also kinda miss Prototype's $(id) syntax, because I don't use jQuery's advanced CSS/XPath selectors very often (if it needs to manipulated, give it an id!)
Prototype is okay, but the things it does in order to get "standard" OO features are a bit restrictive. JavaScript has a very agile syntax and it makes little sense not to make use of it.
Posted: Sat Jan 27, 2007 1:01 pm
by nickvd
Ambush Commander wrote:<...>
I'm currently using jQuery and my greatest problem with it are that you can't stop an animation in midstream. I think mootools.fx has a much more full-featured effects library.
<...>
I also kinda miss Prototype's $(id) syntax, because I don't use jQuery's advanced CSS/XPath selectors very often (if it needs to manipulated, give it an id!)
<...>
Point One: Try
Interface Elements for jQuery, it is a full fledged animation library for jquery. jQuery was never designed to be an animation library...
Point Two: What's wrong with using css selectors with jquery? it's cleaner and quicker to apply the same action to many elements (animating list items, replicating :hover in ie, etc...) $("#id").blah() works just as good, and is pretty must just as quick as the standard document.getElementByid('id').
For example, you want to highlight the current page on your navigation menu (id="current")
Code: Select all
<ul id="nav">
<li><a href="index.html">Home</a></li>
<li><a href="fabric.html">Fabric</a></li>
<li><a href="yarn.html">Yarn</a></li>
<li><a href="crafts.html">Crafts</a></li>
<li><a href="clothes.html">Clothes</a></li>
<li><a href="housewares.html">Housewares</a></li>
<li><a href="stores.html">Stores</a></li>
</ul>
Code: Select all
$(document).ready(function(){
path = location.pathname.substring(1);
if (!path.split('/')[1]) path = 'index.html';
if (path) $('#nav a[@href$="' + path + '"]').attr('id', 'current')
});
Posted: Sat Jan 27, 2007 1:15 pm
by Ambush Commander
Point One: Try Interface Elements for jQuery, it is a full fledged animation library for jquery. jQuery was never designed to be an animation library...
I understand that, and I'm not doing any really fancy animation. But what I'd like to be able to do is override an animation in midstream and do something else to it, which I don't think is possible in jQuery while it seems to be possible in mooTools.
What's wrong with using css selectors with jquery? it's cleaner and quicker to apply the same action to many elements (animating list items, replicating :hover in ie, etc...) $("#id").blah() works just as good, and is pretty must just as quick as the standard document.getElementByid('id').
Yeah, I'm using $('#id'), it's one extra character but it kind of gets to me.

Posted: Sat Jan 27, 2007 5:56 pm
by Christopher
My opinion is similar to Ambush's, but Interface Element looks pretty amazing as well.