Prototype is not the defacto standard

Ajaxian has a pushback at Prototype criticism. Among the criticism is:

A lot of javascript tutorials written today are based on the prototype framework. So, I thought it would be nice to see how other people use prototype.js . What I found is that the majority of people use it only because they think it is easier when in fact, they use only a couple of prototype functions ($() and the AJAX functions primarily).

This is a good point. If you’re only using Prototype to access a page element or make an Ajaxian server-side call, you’re not using Prototype to the fullest, and you’re better using your own homegrown.

I agree with Ajaxian, though, in that there is documentation on Prototype, though the creator of the library seems to be reluctant to make this known. Where I don’t agree with the writer, Rob, is his statement:

…although I’m disappointed to see that Sergio hasn’t updated his excellent reference since May, there are still so many fantastic howto’s and tutorials written using Prototype. Plus the books out now that base much of their code on Prototype.

Nope. My book, Adding Ajax, doesn’t. Covers it, yes, but also covers other libraries, too. More importantly, I create original JavaScript for all my examples so that a person can ‘see’ what’s happening without having to dig through the cryptic Ajax libraries, or without having to take a ‘leap of faith’. Then I demonstrate the examples using one library or another, Prototype among them, so the reader can learn how to use these, as well as write their own code–or do both. I don’t think a book author is doing the readers a service by making them dependent on one library that could go *poof* if the developer got bored with maintaining it. Yes, even a widespread use library like Prototype that’s open source.

I also dig into the libraries, exploring the code, and that includes Prototype because it does have some very clever implementations and nice use of JS. Still, I don’t just write “we’ll use Prototype for this” without explaining why. I don’t know of a lot of other Ajax books that are completely dependent on Prototype, either. Too much is changing in this environment to make folks dependent on one library or another.

I respect Prototype much more than I originally did when I first started using it. However, I still think that $() is confusing to new JavaScript developers, though it’s too widespread now to change. I also don’t fully understand why there isn’t a link to some form of documentation with the library.

This entry was posted in Technology. Bookmark the permalink.

3 Responses to Prototype is not the defacto standard

  1. Shelley: Does the book cover Spry at all? I’m considering a ground-up rewrite (parts of JournURL are six years old now), and I’ll probably end up using Spry for client-side stuff just ’cause I’m essentially an Adobe/Macromedia person at this point.

  2. rev_matt says:

    Which serves to remind me I need to pick up your book. I’ve avoided JavaScript like the plague since the beginning for all the usual reasons, but I’m interested in getting up to speed on it, specifically AJAX. I’ve liked everything else you’ve written so I know that I’ll be getting the sort of introduction to it that I want.

  3. Shelley says:

    Roger, that would spoil the surprise ;-)

    rev matt, thank you for saying this, that means a lot to me. There is errata for the book, not much, but you’ll want to check it out at the O’Reilly site, and download the examples.

    I hope you’re pleased with the effort.