Thursday, November 10, 2016

Review: JavaScript: The Good Parts

While building my Shared Checklist application, I learned JavaScript mostly by reading examples on the web as well as a library copy of Javascript: The Definitive Guide. The problem with learning a language this way is that you're generally clueless about the idiomatic uses of various language features, as well as what general good practice is.

JavaScript: The Good Parts promised to be a good introduction to the latter, so I checked it out from the library. The book's very reasonable if you have a good understanding of Scheme, Self, and one other "classical" object-oriented programming language, and have read SICP. Since I qualify as all of the above, I found the book to be a breeze, reading it in a couple of hours.

In general, I found the explanation to be clear, to the point, and comprehensible. There are a few sections that I thought weren't very good: for instance, he introduces object-oriented programming in JavaScript through the use of a programming paradigm meant to emulate "classical" object-oriented languages. The idea is that most readers come from C++, Java, or some other OO language in wide use. Then he tells you to throw away all that and switch to the Self-like prototypes-based object-oriented language instead. From a pedagogic point of view, he should have gone straight for the prototype based learning approach --- never teach someone "the wrong way" to do something first, and then teach them "the right way."

Nevertheless, reading this book before I'd gone ahead with my JavaScript implementation of Shared Checklists would have been very useful. My code's much messier than it had to be, and there are a few "best practices" that would have made everything neater.

Reading the Amazon reviews, it seems like most of the people who rate this book badly do not have the required background I mentioned above. If you have the right background, reading this book is as much fun as reading Dennis Ritchie's The C Programming Language. That's high praise, and the book deserves it.

Recommended.

Post a Comment