Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Prototype Dominance

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some other places you will see everyone recommending JQuery to solve everything.

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

Eric
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Thanks.
 
David C. Crane
author
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Dave
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic