• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is Prototype simpler than jQuery?

 
Nikos Pougounias
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, is Prototype simpler than jQuery?

Of course this is not a yes or no answer. Let's concentrate in the areas of syntax (e.g. chaining methods) and event handling model (cross-browser compliance).

Thank you
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're right; there is no yes/no answer.

Some might say that Prototype is simpler than jQuery because it invasively adds methods directly to the elements so that you simply call the methods given an element reference. Others would say that jQuery is simpler because the methods are all neatly packaged as methods of the wrapper object returned from applying a jQuery selector.

It could be said that jQuery is simpler because most statements follow a simple pattern of applying a jQuery selector and operating upon it with a jQuery method or chain of methods. Conversely, one might argue that Prototype just lets you write your statements any old way you like.

jQuery's powerful selectors let you pick and choose which elements you want to operate upon. Some say this makes jQuery easier because you can write less code to pick elements; others might argue that the selector syntax is something that needs to be learned.

A lot of "six of one".

With regards to chaining, jQuery has a very nice chaining model where methods that pass the wrapper through can be chained to make statements that perform multiple operations cleanly and simply.

The syntax for declaring and using event handling is different between the two libraries, but I'm not sure one could say that either is simpler or more difficult than the other.

Both libraries have their strengths and weaknesses, and it's nice that because of jQuery's design, both can be used on the same page, if that is deemed appropriate.
[ February 12, 2008: Message edited by: Bear Bibeault ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic