Author: Marijn Haverbeke
Publisher: No Starch Press, 2011
Aimed at: Complete beginner
Cons: Lots of changes in level and topic
Reviewed by:Ian Elliot
Chapter 1 proper begins with a look again at the very basic things that a complete beginner would need to know. What's a value, what's a variable and flow of control. The chapter starts very slowly but the level starts to ramp up. By the time you reach program structure the author is starting to reveal the book he really would have liked to write, i.e. an advanced one.He starts to introduce some doubtful practices such as if statements without brackets - recommended even for single line if statement and breaking out of loops. By the end of the chapter we are dealing with automatic type conversion and Boolean operators.
Chapter 2 is about functions and it still attempts to start slow and be kind to the beginner, but the pace, level and language is getting tougher all the time. The introduction of "Nested Scope" on the third page of the chapter just after dealing with elementary topics should give you an idea of what I mean. We next have discussions of the call stack, returning values and closure. If the introduction of closure in a first look at functions doesn't convince you that the level is going well above the beginner, then perhaps recursion on page 37 will.
From here on each chapter starts with an attempt to appeal to the beginner but rapidly spirals off into esoteric and difficult subjects. Chapter 3 is about data structures - objects and arrays. This starts off as a complete beginner's intro to objects but by the third page it is diving into mutability. The rest of the chapter goes over date representation and some built in objects.
Chapter 4 is on error handling - how to use the try-catch. This is probably a bit early for the beginner to be worried about such niceties.
Chapter 5 is where the book finally shows its true colors with a look at the first of three of the main design philosophies - functional programming. In this chapter we learn about higher order functions and invent map and reduce functions - not really beginner's stuff. The rest of the chapter is an odd (and completely misplaced) fairy tale about HTML and we have gone back to appealing ot the complete complete beginner. Another look at functional programming completes the chapter.
Chapter 7 discusses modularity, which is odd to find coming after object oriented programming. This explains the standard tricks for implementing namespaces and interfaces.