The Art & Science of JavaScript

There is always a market for good well written books on JavaScript, and this is one such book. Sporting a clean, colourful layout, SitePoint's newest "Art and Science" book takes the reader though a couple of chapters that show off what the newest generation of web browsers are capable of, as well as shining a light on some of the more advanced capabilities of the JavaScript language itself.

In these days, when everybody seems to be talking about the latest JavaScript framework, be it jQuery or Dojo, MooTools or re-discovering great-granddaddy Prototype, this book takes the old-school approch: "getElementById()" and so on. I think this was the right decision, as much as everybody (Zend excluded) might be talking about my favourite JavaScript library this year, there was a time pretty recently when everybody seemed to be recommending Prototype-- and no-body was asking if a vaguely 80s Slash belonged on the re-design of the jQuery homepage.

So what does the book hold in it's 250-odd pages? Well it starts of with building a sort-able table, while hinting at the meta-programming coming later in the book. Afterwards, it's on to creating Badges, then a tour of vector graphics with the canvas element. Later chapters cover debugging and profiling with Firebug, and then it's into Meta-programming with JavaScript. Finally there is a bit of a show-off chapter on building a 3D Maze with CSS and JavaScript and then the book closes with a pretty impressive mash-up project involving Flickr and Google Maps.

Of these, three chapters stand out. The first on creating a sortable table introduce readers to accessing elements of the web page, meta-programmings shines a light on the advanced features of the JavaScript language, while the final mash-up chapter really shows what can be done with web services.

The use of web-services is a nice touch. Early on JavaScript was derided as a toy language, and arguably it was true-- beyond form validation and some gimmicky effects, there wasn't a lot that could be done with the language. Since then three things happened, roughly in order: browser standardization in areas like DOM and CSS meant that developers did not have to write-- at least -- two versions of each page, which freed-up developers to turn their brains to more productive ideas. Secondly, early hacks matured into what we now call Ajax, which made it possible to create web sites that behaved more like traditional desktop applications. Thirdly, computers and networks continuted to run faster so that all this was possible in a reasonable time. Web services are a by-product of these the advances, without them web services would have to be done at the server level and this would automatically put them out of reach of many web developers. So one could say that web services are one of the most useful reasons for leaning JavaScript.

Art and Science of JavaScript takes the reader through a series of projects, each designed to show how JavaScript can be used in a website. The chapters take the reader through the steps of creating a sort-able table, using the <canvas> tag to create charts, debugging and web services, along with some advanced areas of the JavaScript language itself. Thanks to its clean layout, it's a quick read, recommended for people looking to re-discover JavaScript.

Published: 6th October, 2008

SitePoint's newest book on JavaScript takes the reader some website projects while learning some surprisingly powerful ways of using JavaScript, both as a tool for manipulating HTML documents as well as the capabilities of the language itself.
Author: Cameron Adams, et al.
Publisher: SitePoint
ISBN: 9780980285840


Related Reviews: