File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Prototype Dominance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Prototype Dominance" Watch "Prototype Dominance" New topic

Prototype Dominance

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

Anyone have any insight into the dominance of prototype vs other similar libraries? I ask because as one of many many contributors to Javaranch, when fielding questions, there is a fine line and arguably an art when it comes to answering questions and either showing the long way around the problem versus suggesting a tool/api/library that already solves the problem.

So is it safe to assume that prototype has a strong enough grip in the community that when someone asks questions that prototype very elegantly solves, we can just recommend it? Or is the long drawn out answer still required. What would you prefer if asking the question?

GenRocket - Experts at Building Test Data
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63873

That's a really excellent question. And as with all such questions, there's no easy answer.

Questions can sometimes fall into the "how does this work in Javascript?" category, in which case, saying to just use a library and get over it would not be appropriate. But many questions fall into the "How do I get such and such a feature on my site?" and in this case, promoting the use of a library that makes "such and such" really easy is not a bad idea.

For example, I think it's rather silly to do Ajax calls directly. Libraries such as Prototype take care of all the "ready change" goop, as well as dealing with cross-browsers issues. A clear win-win.

But, I'm also the type of guy who wants to know how things work before he's comfortable using them. So I'd dig into the principles regardless. I may be a minority among the "I just want it to work" crowd, but I'm sure I'm not the only one.

So how was that for a complete non-answer?
[ March 29, 2007: Message edited by: Bear Bibeault ]

[Asking smart questions] [About Bear] [Books by Bear]
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Some other places you will see everyone recommending JQuery to solve everything.

I think Bear and Dave have a new book to write!

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

And to answer part of my own question I suppose there are some developers that for whatever reason won't be able to use prototype or [insert library here]. I know at my previous employer we couldn't use any open source libraries without them going through an approval process first, which can take a while.

David C. Crane
Ranch Hand

Joined: Oct 13, 2005
Posts: 59
No, Eric! No! Not another book, please!!

Yes, jQuery is getting (and deserving) a lot of attention too, and there are a few other libraries in this sort of space that are worthy of our attention, including MooTools, Mochikit and Base2. There's a healthy amount of cooperation and competition between them all, too - e.g. the recent race to provide the fastest CSS selector function - which benefits all the libraries in the end.

Prototype does dominate at the moment, and for my money is looking to be in fine shape going forward too. I'm usually happy to provide solutions to generic problems that employ Prototype, and add a little caveat 'or similar technique in the library of your choice', if appropriate. I guess it depends on how deep I'm digging into the library. Simple cross-browser DOM stuff, the $() function - which just about every library has anyway - and Ajax.Request are certainly straightforward to translate into any other library's API. Some features of Prototype are more unique to it, such as the extra array functions.


---<br />Author of...<br />'Ajax in Action' <a href="" target="_blank" rel="nofollow"></a><br />'Prototype & Scriptaculous in Action'<br /><a href="" target="_blank" rel="nofollow"></a><br />'Ajax in Practice'<br /><a href="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: Prototype Dominance
It's not a secret anymore!