

Ask YC: jQuery vs Prototype - martythemaniak

I'm curious what people here use for their projects, especially ones making heavy use of javascript.<p>I recently started doing a lot of JS and found prototype to be a lot more useful. I've used jQuery only a little bit, but Prototype v1.6 seems to be able to do everything jQuery is good at (DOM traversing and manipulation) and has other useful things like a extended arrays, hash maps, ranges, classes/inheritance etc.
======
simonw
jQuery. I don't need classes and inheritance (I use closures for pretty much
everything you would use a class for, and on the occasions that I do need
either classes or inheritance it really isn't that much trouble to roll them
from scratch) and philosophically I much prefer jQuery's approach of only
adding one global symbol to my namespace v.s. Prototype adding global symbols
all over the place.

------
whalliburton
Side thought:

The web framework that I use (Weblocks) is built on prototype, but it only
uses a small subset of the code with no reason to send 120K
(uncompressed/unminified) over the wire. I think the next step is to use a
code coverage tool to strip out all the unused code, which is a project I'm
hoping to get a little time on soon. This should (back envelope calculation)
reduce it to less than 25K.

jQuery also plays well with Prototype, so, with stripping, I'm hoping to try
using both. Best of both worlds?

~~~
konsl
I'd love to see this for prototype. Let us know if you ever get around to it.

Mootools lets you do it; you can even choose the type of compression you want
(although I prefer to minify things myself):
<http://www.mootools.net/download>

------
noodle
been discussed before. won't get into the gritty details of one versus the
other. you can find those via some google searches on HN or on the web in
general. here's a start for you:
[http://www.google.com/search?source=ig&hl=en&rlz=...](http://www.google.com/search?source=ig&hl=en&rlz=&q=site%3Anews.ycombinator.com+jquery+prototype&btnG=Google+Search)

but to add some value to the discussion with my post, i'd like to show you
some metrics. usage numbers have them essentially tied, when last year
prototype was far in the lead. [http://ajaxian.com/archives/nitobi-survey-
results-on-ajax-de...](http://ajaxian.com/archives/nitobi-survey-results-on-
ajax-development)

------
eb
<http://news.ycombinator.com/item?id=27962>

------
nickb
We use Proto/Scripta simply because it has better integration with Rails. I do
like jQuery's syntax, however.

------
wayland
I use jquery because it's easy and a lot of plugins

