At the Forge - Book Roundup

Read a good book about Web development lately? Reuven has and is happy to share his latest favorites with you.
JavaScript and CSS

It used to be that a Web developer could get away with working only on the server side, allowing designers to handle everything from JavaScript to CSS. But, as Web applications have become more dynamic and have incorporated more Ajax, it has become increasingly important for all developers to understand and master these technologies.

For all of the buzz around JavaScript, seasoned Web developers know that it is a flawed language, partly in its design and partly in its implementation. One of the best-known JavaScript gurus, Douglas Crockford, recently wrote a short (but excellent) book, JavaScript: The Good Parts (ISBN 978-0596517748). My understanding of JavaScript has been helped a great deal by Crockford's previous writing and lectures, and the book has helped me to appreciate this language more. JavaScript: The Good Parts has helped me understand why I have been so frustrated by JavaScript in the past—beyond issues of browser compatibility. By ignoring the bad parts of JavaScript, the frustration level drops considerably.

Even if you take Crockford's advice into consideration, you almost certainly will want to choose a JavaScript library, such as Prototype, jQuery, YUI or Dojo. I have explored some of these libraries in this column over the past few years, with a heavy emphasis on Prototype, because it is included with the Rails framework. However, there are many good things to say about the others—and in many cases, you might have no say over which library you use. For example, I have started to do some work with the open-source Moodle system for on-line learning, which uses YUI as its toolkit. Similarly, the Django framework for Web development now includes the Dojo toolkit, so you should expect to work with Dojo if you do any Django development.

Although I have been very impressed with Yahoo's YUI toolkit, my default JavaScript library remains Prototype, in no small part because of its close relationship with Ruby on Rails. (The Prototype developers are part of the Rails core team, and development between the two is synchronized.) The Web site for Prototype ( has excellent documentation and even a downloadable PDF version of the API. But, this wasn't sufficient for some introductory classes that I recently gave about Prototype programming, so I have been on the lookout for a high-quality tutorial.

Thus, I was pleased to discover Practical Prototype and, by Andrew Dupont (ISBN 978-1590599198), which is one of the best programming books I have read in the last few months. It introduces Prototype (and its companion GUI toolkit, with on-target, practical and illuminating examples—along with a sense of humor I found refreshing, without getting in the way.

Modern Web pages are styled with cascading stylesheets (CSS), a technology that is quite simple to understand in theory, but it can become complicated when it comes to execution. One book that seems to offer a gentle introduction to CSS is The CSS Anthology, by Rachel Andrew (ISBN 978-0975841983). This book is a cross between a tutorial and a cookbook, allowing you to learn CSS in the context of bite-sized lessons and ideas.

Once you have understood the basics of JavaScript and CSS, and what they can do for your dynamic Web sites, you might want to look at Dynamic HTML: The Definitive Reference, by Danny Goodman (ISBN 978-0596527402). This book looks at the DOM—the document object model browsers use to work with HTML—and explains how you can modify its appearance, as well as manipulate its elements, using a combination of JavaScript and CSS. This book doesn't use any JavaScript library, so some of the JavaScript code might seem long and unwieldy if you are used to the brevity of Prototype. But, for sheer comprehensiveness, nothing beats this book.

The similarly comprehensive latest edition of David Flanagan's JavaScript: The Definitive Guide (ISBN 978-0596101992) is useful when you want to better understand what JavaScript is doing or how an object is defined. Douglas Crockford has noted that this is the only JavaScript book that actually gets the details right. That might be true, but it doesn't change the fact that the text can be quite dense. Don't try to learn JavaScript from this book, but you should have it around afterward, either to refresh your memory or to gain a clearer understanding of how things work.

Finally, I have found The Ultimate CSS Reference, by Tommy Olsson and Paul O'Brien (ISBN 978-0-980285857), to be a useful list of CSS selectors, properties and values. Especially useful is the table indicating the degree to which each browser complies with the CSS standard for each property. The information in this book is available elsewhere, but it is particularly handy if I am not connected to the Internet (which, I'm ashamed to admit, is sometimes the case), or if I just want to skim through a number of related items. My main complaint with this book is its lack of an index, and although I realize you can read and search much of it on-line, adding 5–10 pages of index would have changed this from a good book into an excellent one.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

JavaScript, seasoned Web developers know that it is a flawed

transmit's picture

please, its comment like this that make me think about not renewing my subscription