Book Review: Practical Prototype and Script.aculo.us

The black and yellow cover of the book.In this next installment of Review Fridays, we have a new book from Apress titled, Practical Prototype and script.aculo.us by Andrew Dupont. Andrew is one of the core developers of the Prototype library.

Prototype is the library that helped open up a new world of techniques for me and, likely, many other JavaScript developers with its Ruby-inspired approach. Prototype is automatically bundled with Ruby on Rails and CakePHP, which has led to much of its success.

Things have progressed over the past couple years with plenty of new features having gone into the framework. Andrew Dupont goes into depth in covering the major features of Prototype and then script.aculo.us and does it well. His writing style is humourous and comfortable. The pacing is great. This is one of the best technical books I've read.

I never realized just how much functionality is built into Prototype and found myself surprised a few times as I read this book. While plenty of my recent development has shifted to jQuery, Dupont's book has reminded me of the power that lies in the framework. I fully expect to try out Prototype again on future projects.

Now that I've gushed about the book long enough, allow me to break down how the book is put together. The book is predictably broken up into two parts: Prototype and script.aculo.us. The first chapter gives a quick background of JavaScript techniques, Prototype, and how to get the framework loaded in a page.

Chapters two through eight build on top of each other, expanding on the different features of Prototype such as collections, with Array, Hash, and the Enumerable classes. It covers event handling, working with the DOM, Ajax, and provides an in-depth look at the object-oriented approach that Prototype takes.

One of the great things about the book is that it explains why some things are done the way they are. Why should you use Prototype's event handling? Why should you use Prototype's DOM methods? Andrew gives specific reasons in answering these questions. (One of my complaints about John Resig's Pro JavaScript Techniques was that code solutions were often presented to solve browser issues but the specific browser issues were not explained. Still a good book, though, otherwise!)

After stepping through the Prototype library, Andrew delves into script.aculo.us and explains many of the features of the library such as the effects and UI widgets like edit-in-place and auto-complete. I did find myself skimming this part of the book because it provides solutions to specific problems. While the first part explained how to cook, the script.aculo.us part showed recipes.

Hopefully, I've whet your appetite for a little in-depth JavaScript fun. Be sure to pick up Practical Prototype and script.aculo.us.

Published September 05, 2008
Categorized as Book Reviews
Short URL: https://snook.ca/s/908

Conversation

8 Comments · RSS feed
Nate Klaiber said on September 05, 2008

Thanks for the review. I have added this to my list of books to read in the near future. While I like the simplicity of jQuery syntax, I find that working with Prototype is a little more fluid for me as I am also programming Ruby at the same time. It is very Rubyish - part of what I like about the framework.

I initially had a bad taste for it due to size, and the fact that the usage in the frameworks was mostly obtrusive. Having worked with it for a while now, I find myself checking out the API often to learn more about everything that's going on under the hood to make things easier for me.

Alan Tucker said on September 05, 2008

Currently the only JavaScript framework I use is jQuery but its sounds like that Prototype and Script.aculo.us is worth me having a look. Apress have published some really good books (I have eight or nine of them covering different subjects) and from the looks of it they may have done it again.

Thanks for the review.

Sean McArthur said on September 05, 2008

Just out of curiosity, which is your preferred language? I use Prototype and YUI and my day job, and for freelancing I've been using Mootools. Your preference is jQuery?

One problem I have with using different frameworks, is trying to use Element.insert() in Mootools, when it's Element.grab()... Happen to you?

Jonathan Snook said on September 05, 2008

@Sean McArthur: I've used a bunch of them and try to pick the right one for the job. Recently, I've been doing lightweight UI stuff and jQuery works really well for that. But I like Prototype and I like Mootools, although I'll usually end up picking Prototype over Mootools. I have found myself trying to use the syntax of one in another. Just like sometimes I'll do JavaScript when writing PHP (and vice versa). It can all get a little jumbled. :)

Andrew Dupont said on September 05, 2008

Thanks, Jon! I'm really glad you liked it, and I'm thrilled to hear you might be using Prototype more in the future. Looking forward to seeing you at TAE later this month.

Brett Wilton said on September 17, 2008

Thanks for the review. Just as a side, I was also wondering if you had read any good jquery books as well ?

Mike Spoon said on December 21, 2008

@Jonathan: Do you learn new frameworks (eg. jQuery, Protoype..) by reading books?

Jonathan Snook said on December 21, 2008

@Mike Spoon, I don't but I know some people do. I learn best by digging through the source code of the framework, the code of others using the framework and most of all, I learn by trying to build something.

Sorry, comments are closed for this post. If you have any further questions or comments, feel free to send them to me directly.