There are certain basic qualities I look for in a book on a programming language, and if they aren't present, then I don't care if it's amusing. ThoseThere are certain basic qualities I look for in a book on a programming language, and if they aren't present, then I don't care if it's amusing. Those qualities include a sound, consistent approach, clarity, commented examples that are easy to follow and illustrative of the features they demonstrate, and certain basics of writing, such as "Don't introduce multiple new ideas in a single example."
Of the many books and resources I've seen on JavaScript and Node to date, Haverbeke's book is by far the most deficient in these fundamentals. I can only sigh in exasperation, trying to figure out what he's talking about with his were-squirrel correlation tracking routine, and I can only throw up my hands in disgust, puzzling through his presentation of promises, where he uses a convoluted and extended example of crows using computers in their nests. Hilarious as that image might be (Imagine! Birds programming asynchronously!), the result is that for every such line he writes, I have to figure out for myself how his nonsense examples relate to anything anyone would actually do, and I have to parse each line to figure out if it's part of the joke or contains actual information.
What if instead of analyzing a crow communication network, Haberbeke had talked about interacting with a relational database, and referenced commonly-used libraries and frameworks? Or would that have been to boring?
It's nice to be amusing, but it's necessary to be clear and helpful. This is not the first well-regarded programming book that I've found to be incompetently written, but it's one of the worst.
Update: I would like to note how very many reviews of this book I have seen by people who said something like "Yes, I didn't myself actually understand a lot of it and was often confused, but I can see that it is very well-written."
I think this points to a pervasive problem with how programming books are received - especially books that have acquired an aura of good reputation. Readers who don't understand them assume the fault must lie in themselves - they are simply not equal to the technical challenges.
That may sometimes be true, but I think we should perhaps all ask more from authors of programming books. The strong majority of those that I have read are very badly written, and to any reader, I would say if you make a real effort to engage with a book and still come away confused, and you have a general understanding of programming and languages, most of the time the problem is with the book, not with you....more
Very useful supplement to more practical introductions to JS like the O'Reilly Definitive Guide. Simpson's introduction takes a high-level conceptual Very useful supplement to more practical introductions to JS like the O'Reilly Definitive Guide. Simpson's introduction takes a high-level conceptual look at the nuts and bolts of JavaScript with an eye toward alerting the novice to the importance of understanding how things work.
In particular, he promotes a paradigm for JS programming that he describes as going "with the grain". As I understand it, that basically means understanding how JavaScript works and thinking about programming in terms of its actual mechanics rather than the surface it presents. In one important example, he effectively argues that JS simulates class inheritance when what is really going on is object delegation, and he recommends understanding inheritance in terms of prototypes connecting various objects rather than falling into the trap of thinking about it in more conventional OOP terms.
I'm not qualified at this point to judge that approach, but I have to say on a theoretical level alone I found it extremely persuasive.
Every programming language should have books like this. The effect of reading it is like being introduced by a knowledgeable friend to the quirks and basics of a new language. It is most certainly not a comprehensive general introduction, but fulfills a valuable role. I look forward to reading more of Simpson's books.
Two minor complaints. First, wow, is it expensive - I paid 23 � for this breezy < 130 page book. That is too much. Second, the handful of exercises are not particularly illuminating and are underexplained.
Update: Hm, I may have over-valued the novelty of Simpson's approach. The MDN Web Docs are also very clear about JS's character as a prototype-based language, saying, for example:
"JavaScript classes, introduced in ECMAScript 2015, are primarily syntactical sugar over JavaScript's existing prototype-based inheritance. The class syntax does not introduce a new object-oriented inheritance model to JavaScript."
They actually get this across with a bit less hand-waving. ...more
Of the JavaScript books I've looked at, this is the one I would recommend to any and all people getting started with the language.
On the plus side, iOf the JavaScript books I've looked at, this is the one I would recommend to any and all people getting started with the language.
On the plus side, it is comprehensive, systematic, clear, and generally well-written. I am amazed how often even classic books on programming languages are stuffed with basic errors, such as presupposing information they have not yet explained, not commenting code samples, or introducing multiple concepts at the same time. This volume is free of such errors.
On the negative side, it is systematic and consistent to a fault, always working methodically from basic concepts up to higher-level ideas. This is a good fit with its comprehensive scope, but it comes at a significant cost. Pedagogically speaking, the best way to introduce a new idea is usually to give practical examples and to walk through them. In some chapters, it takes many pages to get to the first concrete illustration of any practical code - in particular, I think of the crucial and very long chapter on client programming.
I found that the author's uniform adherence to a systematic exposition often made ideas more difficult to assimilate, and I sometimes had to put the book down and go to other tutorials for an introduction to ideas that immediately answered my key questions. In my view, all technical documentation whatsoever should begin by answering the questions "What is it?" and "What does it do?"
Despite its liabilities, which make it in some ways more useful as a reference than a practical introduction, as I said I would recommend this book to literally any programmer getting started with JavaScript. Its virtues are considerable, and I have no doubt I will return to it again and again....more