Felocity

Review: The YUI 2.x Cookbook

Cookbooks for web developers are tricky business. Not only is the material hard to write and cover, but the contents also get quickly outdated by new techniques and libraries. The Yahoo! User Interface 2.x Cookbook is no such exception. However, if you’re jumping into YUI 2.x you probably want a copy of this book. It’s target audience is the people who have worked with JavaScript at a beginning to intermediate level and find themselves suddenly working with a YUI 2.x installation. For these people, it’s a pretty indispensable book. For the experienced JavaScript developers, there’s still some gems, but most everything in the cookbook has an equivalent page on the YUI Documentation site.

The Yahoo! Interface Library has been around since 2006. It provides a cross-browser implementation of both common JavaScript operations and common interface problems. Backed by Yahoo!, the library has gained traction on several websites, and is a valid consideration for library choices alongside the other established frameworks. In 2009, Yahoo! released the YUI 3.x product, which is a complete replacement for the 2.x code base. Many sites have YUI 2.x deeply entrenched in their infrastructure though, so it’s likely to be a library web developers work with for quite some time in the future.

Given the YUI site’s completeness, a book on the YUI library needs to bring something new to the table. In this case, organization trumps bulk documentation and creates a cover to cover read which introduces simple concepts first and leads into the more complex parts of the framework. For people just beginning to get their feet wet. the first four chapters really get things off the ground. Of all the stuff Matt writes, the segment on objects within the YUI framework is of particular importance. How YUI builds and extends objects is one of the fundamentals of many later examples (such as the Drag & Drop extensions), and having a firm grasp of the object model used in YUI 2.x makes looking through the rest of the code a lot easier. About the only thing missing is margin notes to reference the code examples on the Packt website.

Unlike the YUI site which puts introduction and APIs upfront, the cookbook is extremely example focused. The theory, the extra tables full of options are all pulled away and practical working examples are presented first. This is both a good and bad thing, although the problems in this approach are more endemic of cookbooks themselves. By focusing on the examples, Matt has made the practical side of YUI very accessible. People can dig through, find code that accomplishes their task, type it up and move on to solving other problems. The downside to this approach is the user doesn’t gain much understanding of the deeper workings of the framework or how to accomplish tasks outside the scope of the book. While most books are not paired with an excellent documentation site, this one is and by referencing the web site throughout, the cookbook can leave the more theoretical topics to the site and focus on the examples.

Wether or not this book is for you will really come down to your skill level and your comfort level in pawing through documentation. If you consider yourself seasoned in JavaScript or love reading technical documentation, this book probably won’t serve you much purpose. However, if you’re the person who just went to the YUI site and spent all your time in the examples, you’ll get a lot of value out of this book.

Title: The Yahoo! User Interface 2.x Cookbook
Author: Matt Snider
Publisher: Packt Publishing
ISBN: 978-1-849511-62-9
Link: Packt Publishing (Not on Amazon as of this writing)

Disclaimer: I received a reader copy from Packt Publishing asking me to share my thoughts on the book. I’m a huge fan of cookbooks which enable someone with entry level knowledge to pick up a complex idea (and later begin playing with it).

This article was written on February 23, 2011

Share this

comments powered by Disqus