This is the first in an occasional series of reviews of upcoming books. Please send drafts, sample chapters etc to anguscroll at gmail dot com
Author: Marijn Haverbeke
Publisher: No Starch Press
Release Date: November/December 2010
Next comes chapters on Functions, Objects and Arrays. Once again the writing is characterized by clear, holistic explanations. The reader is never left feeling they were supposed to know about some critical point that was glossed over. We get the why as well as the how. And the how is developed slowly and logically, with examples that build on one another. One small complaint: The lengthy saga of crazy aunt Emily’s cats which serves as both example and exercise gets a little tedious after a while – this is probably the only section that more advanced developers might want to skip.
Yes, dear, to make pea soup you will need split peas, the dry kind. And you have to soak them at least for a night, or you will have to cook them for hours and hours. I remember one time, when my dull son tried to make pea soup. Would you believe he hadn’t soaked the peas? We almost broke our teeth, all of us. Anyway, when you have soaked the peas, and you’ll want about a cup of them per person, and pay attention because they will expand a bit while they are soaking, so if you aren’t careful they will spill out of whatever you use to hold them, so also use plenty water to soak in, but as I said, about a cup of them, when they are dry, and after they are soaked you cook them in four cups of water per cup of dry peas. Let it simmer for two hours, which means you cover it and keep it barely cooking, and then add some diced onions, sliced celery stalk, and maybe a carrot or two and some ham. Let it all cook for a few minutes more, and it is ready to eat.
Another way to describe this recipe:
Per person: one cup dried split peas, half a chopped onion, half a carrot, a celery stalk, and optionally ham.
Soak peas overnight, simmer them for two hours in four cups of water (per person), add vegetables and ham, and cook for ten more minutes.
This is shorter, but if you don’t know how to soak peas you’ll surely screw up and put them in too little water. But how to soak peas can be looked up, and that is the trick. If you assume a certain basic knowledge in the audience, you can talk in a language that deals with bigger concepts, and express things in a much shorter and clearer way.
Being able to write what we want to do instead of how we do it means we are working at a higher level of abstraction. In practice, this means shorter, clearer, and more pleasant code.”
The chapter rounds out with a nice introduction to functional building-block utilities including function composition and partial application.
There’s a chapter on Modularity which offers techniques that promote tidy, well-organized program structure, and briefly introduces the concept of third party frameworks. Next comes a well-informed, empathetic guide to Regular Expressions. The book is rounded out by four chapters devoted to Web Programming including a crash course in the basics, an introduction to our infamous DOM model and useful overviews of Browser Events and HttpRequests
Marijn Haverbeke is a software philosopher and all-round genius. He also has a terrific sense of humor and writes both prose and code in a friendly and un-intimidating fashion. In common with the very best teachers he dispenses his wisdom with disarming simplicity. I became a better architect, author, mentor and developer because of this book. It deserves to share shelf space with Flannagan and Crockford.