views:

2677

answers:

6

Hi All guys!

First of, thank's for your time;

then i want go directly to the point by saying that, i don't want to open another "Yet Another Js VS Js" 3d , the web is almost busy of this!

I want also make a premise, i have used both theese js frameworks and i love it and i know, that there are a lot of good js frameworks around, maybe better then this two;

but, as you know we need to be perfomant and quickly by doing our works, so i want keep this two, that are the most famous and therefore have a great community support!

now, if you are going to say me, that the choise depends on what i'm going to do!?

then i can think, hey, in the end they are both javascript and they have almost the same methods and functions and for achieve a task they needs almost the same lines of code!

  • So i want hear from you guys, from you that have really used one of theese, for a real Rich Internet Application what are the real points of force and what the weaknesses you find!?

Regards.

+2  A: 

I chose jQuery over Prototype because:

  • the "do more, write less..."
  • the jQuery community is bigger (hence, more plugins and resources)
Mickel
+3  A: 

Neither is the "best". It's all depends. Try them both and see which one you like more. I personally use JQuery due to ease-of-use over prototype which is rather advanced and has longer learning curve.

Have a look at:

Prototype vs JQuery (at Ajaxian)

Sarfraz
thanks Sarfraz!
aSeptik
@aSeptik: You are welcome
Sarfraz
+4  A: 

I initially liked the idea of Prototype's extending elements with new or modified methods.

However, I've discovered a number of reasons this is a bad thing (TM)

Do some googling and you'll probably find some other reasons, but the primary reason is that Prototype cannot be guaranteed to "play nice" with other frameworks or libraries, as other libraries expect the behaviour of elements and methods to be "standard", and due to the things Prototype does, you may find a number of things that are broken by it.

The most recent example I discovered was Prototype screwing with JSON and stringify. I was using EasyXDM, and it simply did not work in some cases where the prototype.js library was loaded. As I was writing a framework to be used by others, and thus did not have control over the content of the page, I needed to create and do everything in an IFRAME in order to ensure things such as prototype.js did not play havoc with what I was trying to do.

...so jQuery wins hands-down for me, because I just don't think its right for a framework to automatically screw with the standard behaviour of the DOM and javascript. YOU should be in control of these things, Prototype takes some of this control away from you....

Graza
this is a nice point!
aSeptik
I should add that in limited cases, where you are in complete control of the page, aren't relying on other libraries, etc, there are some things that Prototype can do well, simply and easily (I particularly like the `absolutize()` method). *But* I don't think it's a good choice for a "default" framework that you use all the time, whereas jQuery and other less invasive libraries are quite safe to include (I particularly like the `.noConflict()` method - all my jQuery stuff is done with `$j` rather than `$`, by using `window.$j = jQuery.noConflict();`
Graza
i must check your answer buddy! ;-) this is the most correct one here! thank's again!
aSeptik
@Graza Have you kept up to date with easyXDM? The latest version actually 'survives' PrototypeJs as it feature tests the JSON object before using it.
Sean Kinsey
Graza
By the way @Sean Kinsey - *thanks* for an awesome framework. EasyXDM is definitely the way to go for cross-domain-cross-frame communication :-)
Graza
If you don't mind, could you send me the patched file, or a description of these (at least those that you cannot affirmatively say have been fixed)? There are probably some use cases that I haven't foreseen :)
Sean Kinsey
@Sean Kinsey - I took this discussion away from Stack Overflow (its a bit off topic for this page) and tweeted you. http://tl.gd/v541p
Graza
and peraphs this is the only responce! that ask my question!!! and let me think that you are the only one that have read it entirely! ;-)
aSeptik
+2  A: 

I use jQuery over prototype as well, just look at the top of this page for why:

jquery tagged questions : 24838
prototype tagged question : 867

jQuery is very terse, concise code, prototype I find much more verbose, tough often equivalent in many areas for functionality. However if you need help getting started, you want the larger community. More support, more of the same questions you'll have already out there answered and easy to google, and more plug-ins, code you're probably looking for to do something...already written.

For the same reasons, the larger the community, the more code, the more complex code, meaning that the simple stuff has been written and many complicated situations solved as well, chances are if you're writing a very rich application you're going to run into some pretty complicated questions or situations...there are more resources out there to help you handle this.

Again...for the same community size reason, more deficiencies in the framework have been found and the gaps filled, because a larger community was scrutinizing it. This means that when you come across a problem, chances are someone else did too, and some method or option was added to keep you moving, not jammed up because you hit something the framework couldn't do.

Nick Craver
thank's for responce
aSeptik
Number of questions does't mean anything. It could mean that jQuery *needs* a lot more questions to be understood/used, or that jQuery is used by mainly unexperiences/unskilled people... All in all, it doesn't mean anything related to the question.
Alsciende
@Alsciende - Show me **any** topic on SO with nearly **thirty times** the number of activity where the community isn't larger...it relates directly to the question, there are more answers out there for jQuery vs prototype. The community size matters, the question count was just an immediate illustration. If prototype had a larger community, their release schedule wouldn't take that long...and since 2.0 changes their syntax up because of the DOM issues they introduced via how their whole model works...I would say jQuery just chose a better path, and it's soaring in usage because of it.
Nick Craver
2.0 ? Prototype stable is 1.6 and RC is 1.7. Prototype chose to extend js prototypes and never looked back. jQuery chose a different path and never looked back. Different needs, different approaches, neither is wrong. Don't be sectarist.
Alsciende
@Alsciende - "Never looked back"...I disagree completely, mainly because the members of the Prototype core team contradict that as well, here's one of them looking back, and discussing 2.0: http://perfectionkills.com/whats-wrong-with-extending-the-dom/
Nick Craver
+2  A: 

This is another interesting article about jQuery and MooTools (MooTools and Prototype are mostly interchangeable, at least within the context of this debate) : http://jqueryvsmootools.com/

Alsciende
+4  A: 

I'm currently rewriting large blocks off an application to move from prototype to jquery. Why? Plugins, plugins, plugins, particularly UI widgets. Prototype UI elements are rather fragmented and very piecemeal, while jquery has a very rich set of "standard" elements.

Mark
+1 for this answer dude! ;-) thank you!
aSeptik