JavaScript: The Good Parts

by Douglas Crockford

On This Page

Description

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, show more author Douglas Crockford identifies the abundance of good ideas that make JavaScr show less

Tags

Recommendations

Member Recommendations

Member Reviews

21 reviews
I'd been meaning to read this for years and finally picked up a copy in late 2019, 11 years after it came out. I'd picked up some JavaScript here and there and have been using JSON since it exploded in popularity. Earlier this year I worked through a book on D3, so I had a decent amount of exposure, but there were still some quirks I didn't have my head around.

This very readable book really clarified things, especially about prototypal inheritance and the unfortunate non-block scoping rules. The "good parts" can be summed up as the "functional parts." There are some great code examples of how to use closures and how to build programs using function expressions. I'm a little leery of some of his suggestions, e.g., in Chapter 4 where show more Function is augmented to obviate the need to type .prototype, if only because I don't know enough about common practice if this advice is generally followed. show less
I'm afraid I must have read this book too late to recognize it as the great new approach to writing about JavaScript that it likely represented for readers when it was new, judging by the remarkably high regard in which readers have held it for years. I know that the world of JavaScript has undergone great upheaval, and evolved very quickly since this book was first published, and have had the interesting experience of working with JavaScript during some of the fastest-changing times it has yet seen, and this book probably rates better than several other books about JavaScript published before it that I have seen.

It is not, however, a great book when considered in a vacuum, without being graded on a curve with other JavaScript books show more published as contemporaries to JavaScript: The Good Parts. Taken by itself, solely on its own merits, this book suffers many failings. It is ponderous, overly technical to the extent that it focuses on technical detail to the exclusion of imparting much real meaning all too often, and plagued by a merciless drought in the dryness of its prose. Many interesting trends in programming techniques and tools have crept into the JavaScript world since this book's publication, and one might argue that Crockford should not be blamed for the lack of any reference to these things in this book, but the terrible fact that many of those techniques and tools existed in abundance in what one might call "neighboring" programming language communities, from which he could have drawn inspiration for writing a much better book, leaves me with a sour taste in my mouth upon finally reading JavaScript: The Good Parts. I find that reading a combination of Eloquent JavaScript, Understanding Computation (and employing its ideas in writing JavaScript with the knowledge gained from Eloquent JavaScript), a small number of decent practical online howtos, and learning about software testing from books written for other programming languages would stand you in much better stead than struggling through this short, but arduous, book -- and probably take about the same amount of time to accomplish. Things get worse when considering this book in full awareness of today's resources, where its usefulness is pretty thoroughly eclipsed by better writings published since JavaScript: The Good Parts.

I would not go quite so far in my distaste for this book as to give it only one star, or to warn everyone to avoid it, as I would for Practical OCaml (an unfortunate, gigantic error of authorship and publication that, if anything, probably turned people away from OCaml). It does, after all, actually offer some amount of information not easily found in one place elsewhere -- even if that information is often abstruse to the point of marginal utility (economics pun only subconsciously intended) at best. That is certainly not enough for me to recommend it as worth reading, or to claim I derived any enjoyment from it, though.
show less
Good stuff with a lot to say about JavaScript and language design. Better reading than most of the big fat JavaScript books on my shelf, with much more useful advice. Fun to read for the author's many snarky comments on the design of the language.
I was never going to be thrilled with this book because ugh, javascript.
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).

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 show more javascript subset he comes up with seems rather clumsy, and verbose, and easy to get wrong -- not very compelling.

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.

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.

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.
show less
This book is a pleasantly succinct tour of only the most powerful aspects of JavaScript. For anyone coming from another programming language and perplexed by JavaScript (as I was), this book will definitely help you to understand the logic of its strange design. Everything in JavaScript (be it a string, array, number, etc.) is actually an object, and every object is built from an object prototype. Most amazing is the fact that you can actually augment these prototypes with your own customized methods, methods which are then inherited by any objects built from the prototypes. In a nutshell, you can change the way the language behaves at a rudimentary level to suite your style and needs. "JavaScript: The Good Parts" teaches you how to do show more this and many other things, as well as warns against which parts of the language to avoid. One of the best aspects of the book is its terseness, which will allow you to read it from start to finish in a month or two and immediately begin putting all of its excellent insights to good use. For anyone with programming experience wanting to get a handle on JavaScript I highly recommend this book.

If you are brand new to programming and are attempting to learn JavaScript as your first language, I would recommend these two books [Learning JavaScript and The Object-Oriented Thought Process] (or any books along those lines) prior to reading "JavaScript: The Good Parts", since without a preliminary grasp of JavaScript syntax and object-oriented programming you may find "JavaScript: The Good Parts" to be highly abstruse.
show less
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.
½
A necessary, perfect book. The only pity is that, after you read it, you will realize the rest of your JavaScript books need to go in the trash.

Members

Recently Added By

Lists

Top Five Books of 2014
1,064 works; 398 members
Books Read in 2024
4,623 works; 126 members

Author Information

Picture of author.
8 Works 1,067 Members
Douglas Crockford is a senior JavaScript architect at Yahoo! who is well known for introducing and maintaining the JSON (JavaScript Object Notation) format. He speaks regularly at conferences about advanced JavaScript topics, and he also serves on the ECMAScript committee

Common Knowledge

Original publication date
2008-05
Dedication
For the Lads: Clement, Philbert, Seymore, Stern, and, lest we forget, C. Twildo.
First words
When I was a young journeyman programmer, I would learn about every feature of the languages I was using, and I would attempt to use all of those features when I wrote.
Last words
(Click to show. Warning: May contain spoilers.)It would be nice if products and programming languages were designed to have only good parts.

Classifications

Genres
Technology, Nonfiction, General Nonfiction
DDC/MDS
005.133Computer science, information & general worksComputer science, knowledge & systemsArtificial Intelligence/Virtual RealitySoftware developmentComputer programmingSpecific programming languages
LCC
QA76.73 .J39 .C763ScienceMathematicsMathematicsInstruments and machinesCalculating machinesElectronic computers. Computer science
BISAC

Statistics

Members
1,020
Popularity
25,429
Reviews
20
Rating
(4.17)
Languages
5 — English, French, German, Japanese, Portuguese (Portugal)
Media
Paper, Ebook
ISBNs
11
UPCs
1
ASINs
2