Mootools vs Prototype vs jQuery vs ?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Mootools vs Prototype vs jQuery vs ?

Post 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?
(#10850)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post 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...
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post 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?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post 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.
(#10850)
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post 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.
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post 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')
         });
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post 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. ;-)
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

My opinion is similar to Ambush's, but Interface Element looks pretty amazing as well.
(#10850)
Post Reply