It’s amazing how much JavaScript has changed over the years. What was once mainly used for creating pop-up windows, rollover images and the like is now an integral part of the modern web, making web applications like GMail and Twitter possible. I first learned JavaScript from the old No Star Press title The Book of JavaScript, published back in 2000. As was typical back in those days, it began with a good into to variables, functions and loops, then taught you how to do common tricks like open new windows and manipulate HTML framesets.
For nostalgia’s sake, and because I enjoyed it’s older predecessor, I jumped at the chance to read No Starch’s fresh new book, Eloquent JavaScript: A Modern Introduction to Programming. Upon opening it for the first time, it was pleasant to see that No Starch uses the same characteristic typesetting and layout.
Marijn Haverbeke takes an unusual approach for a JavaScript book. Instead of focusing on scripting web pages, he teaches you how to program, and JavaScript just happens to be the language. The book, in addition to covering the usual “here’s how to do arrays and stuff,” features more advanced topics like recursion, object-oriented programming, modularity, and other interesting bits of programming theory. It’s examples are even more advanced than is normal, one chapter focusing on how to split input text into paragraphs and extract relevant data from the sentences.
The book also has a wonderful introduction, one that captures the spirit of programming quite well (besides making you feel like a “mighty wizard”).
To some of us, writing computer programs is a fascinating game. A program is a building of thought. It is costless to build, it is weightless, and it grows easily under our typing hands. If we are not careful, its size and complexity will grow out of control, confusing even the person who created it. This is the main problem of programming: keeping programs under control. When a program works, it is beautiful. The art of programming is the skill of controlling complexity. The great program is subdued, made simple in its complexity.
All in all, a JavaScript book and programming primer that stands apart from the rest. A good book for people who want to learn more than how to copy code snippets, and an interesting read more those who already know what they’re doing.