[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Debate: Prototype vs. jQuery

Debate: Prototype vs. jQuery

This item in japanese

With Ajax dominating the Web development scene on the client-side, the question “which JavaScript/Ajax framework is the best” has become a common one. Glenn Vanderburg’s article which compares Prototype to jQuery caused diverse responses from industry experts Douglas Crockford and Dion Almaer.

Glenn Vanderburg starts off by talking about his professional experience with JavaScript and explains how he had the opportunity to work with both frameworks:

Like most programmers who’ve done Rails development, I’ve become very familiar with the Prototype library for JavaScript. Even apart from being built into Rails, Prototype was a natural choice for me. I knew JavaScript pretty well before I started working with Prototype, and was very pleased by how the library filled in some of the weak spots in the language. Additionally, having already been a Ruby programmer for a few years, Prototype’s philosophy seemed very natural; it clearly draws inspiration from Ruby.

Along the way, though, I’ve been hearing an increasingly strong chorus in favor of jQuery. I had taken a cursory look at jQuery and was impressed, but didn’t see anything compelling enough to make me switch. But increasingly the voices favoring jQuery have included people I really respect, including (over the past few months) several of my colleagues here at Relevance.

I’ve now spent serious time working on two different projects with jQuery. I’ve worked alongside some experienced jQuery users, and really increased my knowledge and level of comfort with jQuery. The work has included a reasonable variety of JavaScript tasks, from simple to complex, so I’ve had a chance to enjoy jQuery’s sweet spot and also to see how it stretches.

He goes on giving a detailed list of pros and cons and leans towards Prototype:

I don’t think this makes a slam-dunk case for Prototype over jQuery. And certainly jQuery could improve; its design is not fundamentally limited. (For that matter, many of what I consider the missing pieces in jQuery are available as plugins.) It’s unfortunate that some of jQuery’s API flaws can’t be fixed without breaking compatibility, but in a future version even that may be an option.

At a minimum, though, Prototype can hold its own. For me and many others, it’s still the JavaScript library of choice.

His analysis caused Douglas Crockford, senior JavaScript Architect at Yahoo and father of JSON, to respond in favor of jQuery:

Ultimately, I didn't find Glenn's argument to be convincing, although some of the commenters were happy to hear that they could feel good about remaining ignorant about jQuery. jQuery, being the later library, had the benefit of learning from Prototype's trials, coming up with a wonderfully expressive programming model. But mistakes were made, and jQuery's sudden popularity makes it seemingly impossible to correct those mistakes. Apparently the jQuery community forgives them. Glenn does not. John Resig is also a smart guy, and I imagine that he is frustrated at being knocked for his mistakes while being unable to repair them. Perhaps now he knows how Brendan feels.

Dion Almaer from Mozilla disagrees and finds Prototype closer to his taste:

These days, without any real context (e.g. skills on the team, what the project does) I kinda think:

  • jQuery is fantastic for taking a website and making it dynamic. Easy. elegant. Beautiful. If I was a designer doing a rich site I would stop here.
  • Dojo is fantastic for building a large scale application that will do a lot, and end up with a ton of JavaScript. Everything you need will be found there. This isn’t to say that Dojo can’t be used on the small anymore. The new core is small and fast and good.

Prototype, for me, fits in between these worlds. It is small enough to feel small (not a huge library to learn) yet large enough that I don’t jump out into creating a lot of my own code.

Of course, as Dion points out this debate doesn’t take into account a number of other great frameworks, libraries and toolkits like Dojo, YUI, GWT, MooTools, Ext JS, SproutCore and more.

So, which do you think is the best Ajax framework around?

Rate this Article

Adoption
Style

Related Content

BT