-
Website
http://www.juliocapote.com -
Original page
http://juliocapote.com/post/52467447 -
Subscribe
All Comments -
Community
-
Top Commenters
-
Chris Eppstein
2 comments · 7 points
-
digitarald
3 comments · 3 points
-
alandipert
1 comment · 1 points
-
Matthew Donadio
1 comment · 1 points
-
marcoslhc
2 comments · 1 points
-
-
Popular Threads
Try using it repeatedly and in different browsers, the results vary enough for it to be "fast" but not "faster".
It should also be kept in mind that slickspeed is a selector test. It would be very difficult to make a full on library vs library test.
On another note, I'm going to have to try Mootools, if only because OOP is involved. I'm not saying jQuery needs it, but I'm so used to it as a software engineer that it would be interesting to see used in javascript.
i'm not convinced by the speed results. one to one, jquery performed better on more tests than mootools. overall, mootools did slightly better, but dojo wasted them both.
but honestly, are you going to use that many selectors on any given page?
either way, this comparison isn't that great of a metric.
also, re: #5,
var el = new Element(‘a’, { ‘href’: ‘juliocapote.com’});
try
$('a').attr('href', 'juliocapote.com'). and then chain that with .appendTo().
done.
on a daily basis I don't create sites that require me to use *every* method/functionality that a framework allows. In fact I don't believe there are that many who do :)
The ability to create your own small package of MooTools absoutely rocks when resource sizing is an issue
But that happened only one time and I could convert my clients requirements to MooTools too ;-)
Mootools code is prettier. It's much easier to read and I personally enjoy everything being prototyped (extended) instead of having to rely on a namespace. It just feels more natural, like an empowerment of Javascript.
I think what MooTools really needs is a class/plugin type of repository/forge (I know multiple people are working on this... why don't you combine your efforts and make one "official" place? It would be much better for the community as a whole, IMO).
I've been wanting to write a couple of points on why I prefer mootools over jQuery myself, now I can refer people to this instead :-)
Mootools have really encouraged me to start doing rich client side development again; it's just that easy - add to that the community is excellent on helping out (you can find me in the #mootools channel on irc.freenode.net (6667)).
For example, another developer who sees moo.js being loaded may incorrectly assume that certain functionality is present. This isn't an earth shattering problem, but I think as developers we should do our best to prevent these situations (especially when doing work for a client).
this are never ending topics...
For the past year and a half I have been using MooTools almost exclusively. I recently began working for a new company and was pretty stoked they used jQuery regularly. I only played with jQuery in small amounts prior to this and understood JavaScript really well, so I was welcoming of the learning experience.
After working with jQuery extensively and deploying several projects, I can honestly say that I have never had such headaches with JavaScript until I started using jQuery. I've pretty much convinced my employer to begin using MooTools for future projects and they even let me build a few great Moo plugins for fun (and usefulness, of course). I can't wait to stop using jQuery.
Here's my list of problems with jQuery:
1) Need a plugin here. Need a plugin there. Binding objects to an event? Argh, need a plugin. Ah gotta get the absolute position of an element relative to another element... *sigh*.. gotta find a plugin. Need to parse this JSON string that wasn't part of an XHR request... wow.. I need a plugin. Plugin, plugin, plugin. How many freaking plugins do I have to find and download before I can actually get substantial use out of jQuery? Also, how reputable are these plugin developers? Do people honestly believe that maintaining a library written by 50 different people (49 plugins, 1 jQuery) who do not work together or follow the same coding standard is normal? So if 8 of the 49 plugins I need to run web application with a powerful front end update versions due to bug fixes -- how will I know this? Do I have to keep tabs on them? Yea, I didn't think so. jQuery has less functionality than MooTools core alone (MooTools Core is 60kb compressed with YUI).
jQuery + Plugins = unmaintainable BLOAT.
MooTools has a great library that does far more than jQuery does by default. This means the developers of MooTools took into consideration these features when writing the library. It also means the library is optimized to use these features. (ie: In certain cases Moo devs could mangle the internal structure just a little bit to get things working faster). The developers won't notice since its deep in the internal workings of the library -- but you can speed increases.
In jQuery, even the simplest of things aren't supported out of the box which means I have to download a plugin written by some guy in his basement and put it into production for my client -- kind of risky don't you think? Especially since most of these plugins go through multiple phases of release for a couple months and then support quickly dies out while some bugs go undiscovered for a long time.
2) jQuery still uses JS Packer... why? Check out this link and compare your compressed code with YUI compressor vs Packer:
http://compressorrater.thruhere.net/
Sure I can compress with my choice of compressor but the fact the jQuery uses packer by default means many users will too. Code compressed with Packer is slower. This means if I have to work with someone else's jQuery code chances are they packed the library and all associated plugins, which results in more work for me trying to convince them to use YUI compressor and actually going through and recompressing everything.
3) The code written in jQuery is completely unmaintainable until you start coding it the MooTools way and then once you do, you'll quickly realize jQuery doesn't have the legroom for maintainable code.
Here's a plugin I was recently asked to implement:
http://jdsharp.us/jQuery/plugins/jdMenu/1.4.1/j...
Is it possible to tell from looking at the code what exactly this thing does? The code is a mess. Now multiply this by 100 and imagine the front end part of a web application ... more like the "back-end" part if you ask me :)
I mean seriously:
(function($){
// lolcopter what is this?
});
4) jQuery does not provide the lovely custom events MouseEnter and MouseLeave that MooTools does. Oh now wait... yes it does, but it isn't documented. Oh now wait... it is documented but under MouseOver... huh? I wonder what other secrets I will uncover :)
5) jQuery only has one utility function for strings. To capitalize some text (a very common task) I have to go out and find a plugin or write it myself. I spend more time hunting for plugins or writing my own than time I save by writing $('#myDiv') instead of document.getElementById('myDiv')
6) All the stuff the original poster said.
its faster -> it's faster
it's magic -> its magic
var el = $("");
1. JS does not need any class support, because it has - work with object cloning, not instantiation.
2. Yes, maybe
5. Do like this: jQuery('<div class="someclass"></div>')
6. Yes mootools wins here
7. It is subjective thing - I like more jquery docs
9. It is evil - IE6 leaks well
10. jQuery is only better than mootools, not a revolution
I love this framework because they are less mistakes with the "onload" function by it.
I like them both, but I like Prototype.js better, so there.
1) "Eventually you'll want real classes to structure your UI logic". While This is what you want, the better I get at jQuery the more I use chaining. I also lean toward functional programming and not OO programming, so...yeah. I'm just saying that this isn't necessarily a global drawback as much as a design choice.
2) Ok, I buy that, but again, I see it as a preference thing, because before jQuery, to me 'regular javascript' just wasn't that good
3) Yeah.. you figured this one out (and Webkit Nightly does EVERYTHING faster, it's great...I can't wait for the mainstream version of that)
4) I don't do animations much.. but in my experience jQuery's have been...sufficient. Moo Tools animations do look pretty good
5) $("done");
6) You can do this from SVN...but at 12kbs I think it's really unnecessary
7) I've never checked out the mootools documentation, My experience with jQuery doc has been very good, and my experience with the #jquery on irc.freenode.net has been very good as well
8) I haven't done anything outside of 'basic usage' with mootools, but jquery isn't an 'unintelligible mess' by any means.
9) Yeah, this is just preference, but unobtrusive is worth it, especially if you have to have two versions of the same library on a page.
10) I for one welcome our new namespaced overlords.
.."Not that it doesn't stand up on its own right, but I have to throw my $0.02 in"
My reasoning:
It has a number of methods that are not available with MooTools.
It has better documentation (really easy to find on their api page).
Though, MooTools has some features that prototype doesn't. Like the getScrollSize() method, and all of the snazzy effects (which are nice). For those effects you could go with script.aculo.us, but the MooTools effects do seem better (+ smoother).
I've had way better luck with jQuery. I haven't run into any show-stopping bugs (actually, none at all), and even if I did the releases are much more frequent .
I write all of my JavaScript as if it were a jQuery or Greasemonkey script nowadays, even if I'm not using a library. Unobtrusive, graceful degradation, accessibility, speed, and the benefit of beautiful, structured code. I have used probably every JavaScript library at some point. Prototype was my favorite when it came out, then MooTools, and now it's jQuery. I'll never go back. =)
I just have one problem with this post however...
#6 Modular
By definition of the title it implies that it is in modules, but you say that it is all in one class, this is then a misnomer. I agree having all the functionality in a single class has its pros and cons vs many classes, BUT, that is not modularity, it is more like singleton.
If mooTools can be extended then that would be the reason for arguing for modularity, but not the single file thing.
Graham
Graham
Your choice of framework is a very personal decision and we just want to let you know that we appreciate you using jQuery and we're here to help if you need us.
Rey Bango
jQuery Team
I think it's important for everyone to remember, the JavaScript libraries and frameworks aren't competing... We aren't at war with each other, we are all collectively at war against browser inconsistencies, and limitations of the JavaScript language itself.
Since all the framework authors understand this, I think it's important for us to start conveying to our users how important it is for them to understand it as well.
That being said, choose the framework you think is best for the job, and squeeze all the functionality you can out of it ;)
Some time later I got known to jQuery and now I can say it fits my needs better. I've never been very good with javascript and jQuery seems to be more understandable to me.
But as I said, the're both great frameworks!
I like the list you came up with. Please note that I think the scope of our project is much bigger, you cannot just compare jQuery and MooTools like that. MooTools just happens to have functionality that is similar to that of jQuery's (Element, Fx, Request) because it is generally needed when programming on the clientside.
In the near future we will try to make everything even better, just stay tuned for the changes. Btw. it is the first time ever someone said that our documentation is better. Maybe you just think like we do, care to get involved? ;)
Bye
Douglas Crockford's "Javascript: The Good Parts" is one of the best references I can recommend.
For #9: Extending native prototypes is great in principle, but can lead to incompatibilities where you never expected them. Try dropping MooTools into a legacy project that relies heavily on plain-old javascript. Namespacing is the only way to avoid this pitfall, and jQuery does it masterfully.
About the "Class Support", JavaScript (or ECMAScript) is a Object Oriented Language, but its object model is not "Classical" it's "prototypical". For many years people tried to use and teach Javascript as kinda subset of Java or C++ but, in fact, the philosophy behind JavaScript is totally different. It was meant to extend the behavior of a client app like the browser, so you don't really need classes with native data types, you just need Objects that extends functionality established in the DOM prototypes or the browser prototypes. In this philosophy is important also to bind names and make callbacks 'cause you never work with native data files on client machines (except for cookies with their limited uses), they are an efficient way to work further with data after it have been sent and previously manipulated. The "chain" (or what you call "SQL-like sintax") is actually a real good way to represent and understand the nature and function of binds and callbacks.
About the "Prototype Approach", I think in the long term, specially if you work in a team having unobtrusive code is way too important, even more important than file sizes, it's a matter of scalability. I will defend jquery in this saying that more than a function library, jquery is a Framework with its own model and methodology, it have its own method to apply and extend the models and functions proposed by its author. That's why the whole namespace and wrapping thing. If you want "shorter, natural code" stick with a library with "Prototype Approach", if you want a team-friendly environment to develop scalable javascript interfaces and applications, a framework with its own namespace.
http://rivals4ever.com/view_rivalry.php?r_id=68...
Cast your opinions here!