Archive for December, 2006

Book Review: CSS Cookbook, 2nd Edition

December 31, 2006

CSS Cookbook, Second Edition, by Christopher Schmitt, O’Reilly Media, 2006.

First things first. You should have some experience with Cascading Style Sheets before diving into this book. It will not teach you CSS, but you will learn some really nifty shortcuts and tricks using CSS. The book assumes its readers “possess some web design or development experience either as a hobbyist, student, or professional.” Take the assumption seriously. But even if you’re an expert at CSS, don’t overlook the book. It should make a handy resource, especially in terms of interoperability.

For those of you who are weak or rusty with CSS, the first chapter provides a good refresher. Go lightly through it, however, since there are some errata which can leave you scratching your head. Most of the errata in the rest of the book is obvious and doesn’t detract from the content, although the typos can be a bit annoying.

The book is structured in a problem-solution format, categorized by type. For instance, “Creating a Hanging Indent,” a handy technique to know, is in the Web Typography section (Chapter 2). It begins with a statement of the problem, “You want to create a hanging indent,” offers a solution (in this case, pretty brief), then goes into a lengthy discussion of the problems, workarounds and related issues (such as, in this case, paired hanging indents). The “problems” range from fairly simple and obvious to complex, using javascript. I should probably note that there is very little explanation of the javascript when it is included in solutions or discussions. The assumption is that you already have some knowledge about it. I should probably also note that when javascript is included, there are instructions on where to obtain the needed code, and how to include it.

Many of the solutions also include using images. Again, there is the assumption you know how to create or modify the image needed. Like the solutions using javascript, the instructions typically tell you where to get the needed image. But some, like the “Rounding Corners” techniques, tell you to create a rounded corners design, then tell you how to modify it for the solution.

On the issue of cross-browser compatibility, there is a very handy section (Chapter 11) on Hacks, Workarounds, and Troubleshooting, and a section in the index with tables showing the implementation of CSS elements in different platforms and browsers (also available from O’Reilly Media as a pdf file). But compatibility issues, if there are any, are also dealt with in each problem-solution set. IE 7 is also included in the discussions.

On the whole, except for the typos and errata (which, unfortunately, were not listed on O’Reilly’s site at the time of this writing), this is a good, solid reference book. I like the discussion part of the solutions, which not only explain the how and why, but often give alternatives and discuss issues which impact implementing the solution (such as validation, and compatibility). While not a book to start out with, it is definitely a book to expand your knowledge and skills.

Book Review: Learning Javascript

December 4, 2006

Learning Javascript, by Shelley Powers, O’Reilly, 2006.

This is not a book for beginners. Let me repeat: this is not a book for beginners. Although the Preface states, “Readers of this book should be familiar with web page technology, including CSS and HTML/XHTML … [p]revious programming experience isn’t required, though some sections may require extra review if you have no previous exposure to programming,” there is a strong assumption from the start that the reader at least (a) has some experience with current programming concepts and practices, (b) has some experience with web page coding and practices, or (c) has a lot of time to learn (a) and (b) while working through the book. That said, however, this really is an excellent resource.

I fall into categories (a) and (b) above, but I’m rusty when it comes to javascript, and wanted something of a refresher. Instead, the book had the effect of dropping me into a working laboratory where everything, though nicely explained, remained confusing for quite a way into the book. But by the time the author got to the complex stuff, it all made sense and fell together perfectly, rather like finally understanding how all the tools in that laboratory make everything work so smoothly.

The book seems fast paced, and often left me wishing there were more detailed explanations of some of the examples. But the concepts and examples are interwoven, so just working through the book brought some understanding. The end of each chapter has review questions, with the answers at the end of the book, for those who find that helpful. But what impressed me was that the errata sheet is already available at O’Reilly. There are a few errata, and they’ll be handy to know if you’re trying the examples given in the book. Additional resources are also sprinkled throughout the book which all appear to still be working.

The author’s practical bias comes through very strongly in the book. In the introduction, and throughout the book, there are frequent “best practices.” Paramount to her philosophy of best practices is the admonition, “whatever JavaScript functionality you create, it must not come between your site and your site’s visitors.” Consequently, she often recommends solutions other than javascript to ensure accessibility by all types of browsers and users. There are also good discussions of the issues surrounding using javascript, especially the cross platform issues and what is on the horizon. Because of the browser compatibility issues, the author covers work-arounds each step of the way, with different options and a discussion of what works best and why.

If book titles are supposed to be descriptive of the content, I’m not so sure “Learning Javascript” is the best title for this book, although it fits well if one thinks of it as learning another programming language. You’ll find this book a lot more helpful if your familiarity with web technology includes using CSS and XHTML, or if you have some experience with another programming language.