Author: Chuck Hudson & Tom Leadbetter
Pros: Tackles topics in a highly practical way
Cons: Disconcerting layout, some code presented without sufficient explanation
Reviewed by: Ian Elliot
HTML5 isn't a programming language, but it is having a profound effect on programming. Does it merit a cookbook style approach?
The trouble with cookbooks is that they are often misnamed introductions to topics. A good cookbook should show you how to do standard and common tasks that, without its help, might be difficult even if you know a bit about the subject. This particular cookbook takes an interesting approach in that it labels its recipes with beginner, intermediate and advanced.
The book starts off with a look at HTML5, i.e the new tags and the way that they should be used. The first two chapters explain the way that the new semantic tags should be used. As you might expect for this sort of topic the recipes are not very deep, even when they get the "advanced" label. These chapters are really an introduction to HTML5 presented as a cookbook. If you like this sort of presentation then there is no problem. However, you do need to know that the actually layout of the book isn't easy on the eye. The text is small and the layout crushed - which makes the, sometimes long, listings more difficult to read.
Chapter 3 is the start of an increase in the technical level of the book. It is about the browser compatibility problem. The recipes are about testing for HTML5 features and using jQuery and Modernizr to make up for missing features.
Chapter 4 deals with CSS3 and the new features such as gradient fills, animation and so on. Chapter 5 is about the new web form tags and here the recipe format works best with lots of standard tasks explained. Chapter 6, however, is more like an introduction to Canvas chopped up into recipes - the level is fairly basic.
From about this point in the book the emphasis moves to the APIs that have been introduced with HTML5. Chapter 7 introduces the video tag and the media API. This is a bit more advanced than earlier chapters but it would benefit from being longer as this is an important and tricky topic. Chapter 8 deals with audio in the same way. Both chapters have examples that run over several pages of listings.
The rest of the book has chapters on the browser API, the Geolocation API, client-side storage, websocket API, Web Workers, drag-and-drop API, cache API, Notification API, local file and the device API. Most of the topics start with a brief introduction and then move on to more advanced and occasionally quite long examples.
If you like learning from examples then you will like this book but be warned there are some very long code listings with little accompanying explanations. However none of the code does anything difficult so you should find it easy enough to follow - if occasionally a bit tedious.
The book doesn't really fit into the cookbook pattern; it is more like a set of examples designed to show you how the basic ideas work. Overall, it is a reasonably successful explanation of HTML5 and if you like a practical approach it is a good choice.