Categories
JavaScript

Prototype is not the de facto standard

Recovered from the Wayback Machine.

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.