Eloquent JavaScript: A Modern Introduction to Programming book review
written by craig, 14 April 2011
On first glance, you might expect “Eloquent JavaScript” to be just another code book. There are few diagrams; just 196 pages of text and code samples. Don’t let that put you off.
Despite being the most-used programming language on the planet, JavaScript is the most misunderstood. Desktop and server-side developers used to sneer at JavaScript but it’s finally being recognised as a flexible language which can be used to build full-scale applications.
The author, Marijn Haverbeke, admits to despising JavaScript but came to love its liberal style and flexibility. Eloquent JavaScript has been written for those who are new to programming or perhaps taking their first steps in the language. There are 12 chapters:
- A good introduction to variable value types and control flow statements. Nothing too scary for programming novices.
- Functions. While many development books might keep this simple, Haverbeke delves into more advanced topics such as closures and recursion. I suspect it might be a little confusing for some, but they’re succinctly explained.
- Data structures such as arrays and object literals. An amusing example which extracts cat information from emails is provided.
- Error handling. A useful chapter since many experienced developers never consider JavaScript errors. Exceptions and automated tests are explained.
- Functional programming. Stories such as the split-pea soup recipe and the semi-autobiographical “recluse writing a technical book” are used to explain concepts such as abstraction.
- Object Orientated Programming. This is a long chapter which delves into the intricacies of JavaScript objects and prototypal inheritance. Good example code is provided which creates a terrarium simulation with animated insects.
- Modularity. The author explains how modules can be used to separate code.
- Regular expressions. A solid and concise explanation is provided.
- Web programming crash course. The chapter provides a brief overview of browsers, forms and associated technologies. Leaving this toward the end of the book may seem odd, but it’s logical.
- The Document Object Model and
- Events are two areas which confuse the most skilled browser developers. The concepts are well covered and the author uses the new techniques to convert the terrarium code into a working version of Sokoban!
- HTTP requests are explained with reference to Ajax using both XML and JSON message formats.
Eloquent JavaScript is well written, and uses a chatty, informal style which is easy to read. The stories and code samples are genuinely amusing without becoming silly.
My only reservation concerns the audience. Is JavaScript a good first language to learn? Most new developers will be writing it in their browser — a fairly hostile and unforgiving programming environment. I also suspect the OOP chapter, although well explained, could terrify new developers.
Overall, Eloquent JavaScript is a great book if you’re learning JavaScript. More experienced developers are likely to skip a few chapters, but even they’ll still find something of interest. Recommended.
- categories: javascript
- trackback: http://www.optimalworks.net/blog/2011/web-development/javascript/eloquent-javascript-a-modern-introduction-to-programming-book/trackback
- bookmark: del.icio.us, digg, facebook, twitter, reddit, Furl, Spurl, Blinklist, Slashdot, Technorati, Yahoo!
