This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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?
That's a really excellent question. And as with all such questions, there's no easy answer.
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 ]
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.
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="http://manning.com/crane" target="_blank" rel="nofollow">http://manning.com/crane</a><br />'Prototype & Scriptaculous in Action'<br /><a href="http://manning.com/crane3" target="_blank" rel="nofollow">http://manning.com/crane3</a><br />'Ajax in Practice'<br /><a href="http://manning.com/crane2" target="_blank" rel="nofollow">http://manning.com/crane2</a>