JavaScript: The Good Parts : Working with the Shallow Grain of JavaScript, Paperback Book

JavaScript: The Good Parts : Working with the Shallow Grain of JavaScript Paperback

4 out of 5 (6 ratings)


Most programming languages contain good and bad parts, but JavaScript has more than its share of the bad, having been developed and released in a hurry before it could be refined.

This authoritative book scrapes away these bad features to reveal a subset of JavaScript that's more reliable, readable, and maintainable than the language as a whole-a subset you can use to create truly extensible and efficient code.

Considered the JavaScript expert by many people in the development community, author Douglas Crockford identifies the abundance of good ideas that make JavaScript an outstanding object-oriented programming language-ideas such as functions, loose typing, dynamic objects, and an expressive object literal notation.

Unfortunately, these good ideas are mixed in with bad and downright awful ideas, like a programming model based on global variables.

When Java applets failed, JavaScript became the language of the Web by default, making its popularity almost completely independent of its qualities as a programming language. In JavaScript: The Good Parts, Crockford finally digs through the steaming pile of good intentions and blunders to give you a detailed look at all the genuinely elegant parts of JavaScript, including: * Syntax * Objects * Functions * Inheritance * Arrays * Regular expressions * Methods * Style * Beautiful features The real beauty?

As you move ahead with the subset of JavaScript that this book presents, you'll also sidestep the need to unlearn all the bad parts.

Of course, if you want to find out more about the bad parts and how to use them badly, simply consult any other JavaScript book.

With JavaScript: The Good Parts, you'll discover a beautiful, elegant, lightweight and highly expressive language that lets you create effective code, whether you're managing object libraries or just trying to get Ajax to run fast.

If you develop sites or applications for the Web, this book is an absolute must.


  • Format: Paperback
  • Pages: 172 pages, 1, black & white illustrations
  • Publisher: O'Reilly Media, Inc, USA
  • Publication Date:
  • Category: Web programming
  • ISBN: 9780596517748



Free Home Delivery

on all orders

Pick up orders

from local bookshops


Showing 1 - 5 of 6 reviews.

  Previous  |  Next

Review by

Crockford, the irreverent guru, takes us on a whirlwind tour de force through the parts of JavaScript that matter. Condensed and pithy, this is a must-read guidebook for even seasoned web devs. Finally. I understand closures. Finally.

Review by

some of the topics touched by this book are very important but it's a pity that at times the narration is very very dry, it becomes like a conversation between the author and a reader that needs to know a priori what the author is going to point or at least have a feeling about it. Examples are not enough and they are outside of a context or story so it's fairly difficult to get the whole picture unless you let yourself drive by an illusion of knowledge. Maybe a design patterns approach, at least for some topics, showing alternatives and forces and contexts, would have helped. But is also true that the book would have been much much bigger and maybe too expensive.For example if you want to learn about closures, callbacks and other patterns in practice, there are better resouces, for example Stoyan Stefanov books. Of course this book has the merit to be one of the first to focus on design issues and reading it will not be bad anyway.And the book is designed to cover only the ECMA specification, not the various practical uses of the language in contexts like browsers, scripting engines, etc. So, concluding, this book shall be good for Javascript experts that are just looking for a formalization of important core language best practices or for those that have followed for long time the wrong directions (as the author says too many wrong books have been written on javascript) and want to steer in the right way, knowing that maybe they will also need to look for other resources. But is not the best for the wider audience of programmers that want to learn Javascript the right way and in its most practical applications.

Review by

This along with JavaScript: The Definitive Guide are the two must read books for any JS programmers out there. Crockford lays out in very clear terms what's good (and bad) about JS in it's current form. His guidelines for how to use it effectively seem very solid based on my experiences.It helps that you can easily read through the majority of this book in a couple hours. But it's also one to keep around and flip through every so often when you need a refresher.

Review by

Javascript is a beautiful language with some pitfalls. This book provides a thorough introduction to its flaws and how to avoid them.The book is terse in some places -- for example, I wish Crockford had justified his distaste for the "continue" statement -- and somewhat repetitive in others, yet the book is a great way to gain insight into the flow of the language.A lot of what is great about modern Javascript, from "use strict" to CoffeeScript to various linters, derives from Crockford's criticism.

Review by

I was never going to be thrilled with this book because ugh, javascript.<br/>But I was expecting more than a typical 2-star throwaway tech book. It was hard to get past the inconsistency (globals variables are bad, let's tack new methods onto global prototype objects!), bad editing, and repetition (I think one code snippet was repeated a total of 3 times).<br/><br/>A lot of people seem to like this book. If the idea of subsetting a language to produce a better variant is new to you, or if you've been stuck in the javascript salt mines, without noticing the river Lisp curving its way through them, or perhaps if protypical inheritance is a new concept for you, I can see how it could be a breath of fresh air. None of that holds for me, so it wasn't. The javascript subset he comes up with seems rather clumsy, and verbose, and easy to get wrong -- not very compelling.<br/><br/>Also, I disliked the railroad diagrams. In most cases a short English description would have been easier to understand, or a BNF would have been easier to read and equally precise. Many of the diagrams seemed gratuitous. They may read better on paper than on a screen. I read it in epub format, which also suffered from an unclosed italics tag messing up a chapter.<br/><br/>The parts I did like: The evidence of a keen mind on the other end of the book, and occasional flashes of insight. The clearest descripton of the "this" scoping mess that I've seen. Good descriptions of many of the stupid gotchas in the language, including the craziness that are javascript arrays. <br/><br/>If it had been called "Javascript: The Bad Parts (and a not very compelling attempt to work around them)" I'd probably feel like I got my money's worth.

  Previous  |  Next

Also by Douglas Crockford