Software Reality
Programming with
a dose of satire.

Site Map Search


Agile Development
 
Extreme Programming
 
Code Generation


Articles
Geek Fiction
Lifecycle
Design
Programming
Soapbox
Reviews

Use Case Driven
Use Case Driven Object Modeling with UML: Theory and Practice
Get from use cases to working, maintainable source code. Examples use Spring Framework, JUnit and Enterprise Architect

Agile UML
Agile Development with ICONIX Process
A practical subset of agile development techniques, illustrated by example

Get Controversial!
Extreme Programming Refactored
Extreme Programming with a dose of satire
Available now:



Reviews

Book Review: JavaScript Phrasebook

Javascript Phrasebook

Title: JavaScript Phrasebook
Author: Christian Wenz
Publisher: Sams Publishing
Buy On-line: amazon.com amazon.co.uk

Reviewed by Matt Stephens
November 17, 2006

(This review originally appeared in Matt's blog at ADT Magazine)


Pocket books have a certain appeal: If you’re traveling abroad, you can slip a phrasebook into your back pocket while trekking through a remote village. Then, quick as quick as a flash you can be flipping through it searching for the perfect phrase with which to ask a local for directions to the nearest art museum (for example).

Being pocket-size is one thing, but there’s also something compelling about the “quick fix” phrase translator. Saves having to learn an entire foreign language after all, when all you really want to do is say something approximating “My cat is stuck down a well, please send help.”

When you’re programming or doing web development, the “quick fix” can be just as compelling. Sometimes it’s exactly what you need: having identified a problem, e.g. “I need to download a remote library”, to be able to flip through a programming “phrasebook” and find exactly the code snippet, or a near approximation, to do what you need. It explains the popularity of the Java Developer’s Almanac (which could be thought of as a catalog of Java code snippets).

The subject of this review – the JavaScript Phrasebook – has a similar approach, but as the name suggests, its author Christian Wenz has taken the “phrasebook” metaphor literally, and produced an excellent pocket-book packed with JavaScript code snippets, or “phrases”, for all sorts of useful tasks. It's surprising how much information the author has managed to pack into such a small space.

 

 

The book starts with JavaScript basics: using external JS files, dynamically loading JS files, using event handlers etc; then it covers the more commonly needed phrases such as detecting the browser type, preventing caching, and reloading the page. Later, the book ranges into form-related phrases such as disabling form elements and validating selection lists.

But the book goes beyond just “monkey-see-monkey-do” code snippets, as it’s also instructional. Accompanying each phrase, there’s a half-page or so of text explaining the theory. It’s a good halfway-house between theory and pragmatism.

For example, say you need to access individual rules within a style sheet. The CSS chapter provides the perfect “phrase” for the job, but also explains how the behavior differs between browsers, and provides a couple of examples to illustrate the differences.

The result is a book that’s more than just skin-deep, i.e. you won’t just find the perfect code snippet to type in and solve the current problem... you’ll actually learn something new at the same time.


More book reviews:

The Zen of CSS Design (Dave Shea and Molly E. Holzschlag)

Pro Spring (Rob Harrop and Jan Machacek)

 

<< Back to Reviews

<< Back to the Front Page

 

 

All trademarks and copyrights on this page are owned by their respective owners.
Stories and articles are owned by the original author.
All the rest Copyright © 1998-2008 Matt Stephens. ALL RIGHTS RESERVED.