Buy new:
$16.49$16.49
FREE delivery: Saturday, Feb 11 on orders over $25.00 shipped by Amazon.
Ships from: Amazon.com Sold by: Amazon.com
Buy Used: $7.39
Other Sellers on Amazon
& FREE Shipping
97% positive over last 12 months
FREE Shipping
98% positive over last 12 months
& FREE Shipping
91% positive over last 12 months
Usually ships within 2 to 3 days.
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required. Learn more
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
JavaScript: The Good Parts: The Good Parts 1st Edition
| Price | New from | Used from |
- Kindle
$6.30 - $13.01 Read with Our Free App - Paperback
$7.39 - $16.49101 Used from $1.49 24 New from $16.49
Enhance your purchase
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.
- ISBN-100596517742
- ISBN-13978-0596517748
- Edition1st
- PublisherO'Reilly Media
- Publication dateMay 1, 2008
- LanguageEnglish
- Dimensions7 x 0.38 x 9.19 inches
- Print length176 pages
Frequently bought together

- +
- +
Customers who viewed this item also viewed
From the brand
-
-
Sharing the knowledge of experts
O'Reilly's mission is to change the world by sharing the knowledge of innovators. For over 40 years, we've inspired companies and individuals to do new things (and do them better) by providing the skills and understanding that are necessary for success.
Our customers are hungry to build the innovations that propel the world forward. And we help them do just that.
From the Publisher
From the Preface
This is a book about the JavaScript programming language. It is intended for programmers who, by happenstance or curiosity, are venturing into JavaScript for the first time. It is also intended for programmers who have been working with JavaScript at a novice level and are now ready for a more sophisticated relationship with the language. JavaScript is a surprisingly powerful language. Its presents some challenges, but being a small language, it is easily mastered.
My goal here is to help you to learn to think in JavaScript. I will show you the components of the language and start you on the process of discovering the ways those components can be put together. This is not a reference book. It is not exhaustive about the language and its quirks. It doesn't contain everything you'll ever need to know. That stuff you can easily find online. Instead, this book just contains the things that are really important.
This is not a book for beginners. Someday I hope to write a JavaScript: The First Parts book, but this is not that book. This is not a book about Ajax or web programming. The focus is exclusively on JavaScript, which is just one of the languages the web developer must master.
Editorial Reviews
About the Author
Douglas Crockford is a Senior JavaScript Architect at Yahoo!, well known for introducing and maintaining the JSON (JavaScript Object Notation) format. He's a regular speaker at conferences on advanced JavaScript topics, and serves on the ECMAScript committee.
Product details
- Publisher : O'Reilly Media; 1st edition (May 1, 2008)
- Language : English
- Paperback : 176 pages
- ISBN-10 : 0596517742
- ISBN-13 : 978-0596517748
- Item Weight : 10.2 ounces
- Dimensions : 7 x 0.38 x 9.19 inches
- Best Sellers Rank: #64,835 in Books (See Top 100 in Books)
- Customer Reviews:
About the author

Douglas Crockford is the author of How JavaScript Works. He has been called a JavaScript Guru, but he is more of a Mahatma. He was born in Frostbite Falls, Minnesota, but left when he was only six months old because it was just too damn cold. He has worked in learning systems, small business systems, office automation, games, interactive music, multimedia, location-based entertainment, social systems, and programming languages. He is the inventor of Tilton, the ugliest programming language that was not specifically designed to be an ugly programming language. He is best known for having discovered that there are good parts in JavaScript. That was the first important discovery of the Twenty First Century. He also discovered the JSON Data Interchange Format, the world’s most loved data format.
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonReviewed in the United States on July 17, 2019
-
Top reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
My TL;DR version of the review: this book is a hodgepodge of different information about the language, but some of it is so complicated it'll go immediately over the heads of new programmers, and then some of it is so mundane (even pedantic, talking about very specific aspects of coding styles) it felt goofy and out of place. It seems to me that any specific individual reading this book won't really find more than one or two chapters very relevant. I give it 3 stars because the useful parts were useful to me, but I skimmed and ignored 80+% of the book.
Crockford's writing is personable and clear, and the book's organization is straightforward. Here's my chapter-by-chapter breakdown. Note that this is all from my perspective, what I personally found useful or not, but my point is, while other readers will certainly disagree with me about what was useful, I have trouble imagining any one person finding more than about 20% of the book useful.
Chapter 1 is an introduction and high-level explanation of the point of the book.
Chapter 2 covers basic grammar and the likes, which was helpful though it's not aimed at any particular familiarity with other languages so it's trying to be comprehensive, which meant that as an experienced programmer in other languages I had to skim it and just look for differences with what I'm already used to.
Chapters 3 and 4 were the most useful parts of the book for me: the section on objects and functions, data scoping and closure, which really takes a new way of thinking if, like me, you have a lot of experience with languages without closure and anonymous functions and the like. Crockford does a good job of explaining this and giving relevant examples. This section was 20% of the book and was the only section I found really useful.
Chapter 5 covers inheritance. He presents two methods, one using new and constructors like one of the languages I'm more used to, and gives a couple reasons to avoid this, and then digs into the prototypal method, which is unfamiliar to me. The problem is that he uses totally abstract examples here - classes representing animals and methods that return their names or the noises they make - and it was very hard for me to relate it to any actual application, and since the prototypal style is a fundamentally different paradigm I don't feel like I really grasped it from his writing. Since he builds a framework of extension methods throughout the book, once I started to lost his train of logic I was utterly lost. And the "meta" nature of javascript, assigning functions to methods that return other functions that wrap functions, I found it easy to get lost.
Chapter 6 covers arrays. If you've used scripting languages this stuff is very simplistic, a stark change from Chapter 5, which is quite sophisticated. Again, my point here - I don't know who would simultaneously understand Chapter 5 and still find anything in Chapter 6 useful.
Chapter 7 is a significant change of direction; it's a long chapter on regular expressions which I skimmed very quickly since I know them from using perl. This part seemed odd, since regular expressions are common to several languages, and there's nothing particularly unique about javascript's usage of them. It felt a bit misplaced in this book. Certainly they're an important part of the language, but again made me wonder: who's the book for?
Chapter 8 is a reference for core API functionality and his extension methods; this feels like stuff I'd just google while coding, not terribly valuable to me personally.
Chapter 9 is a diversion on coding style, and felt wildly out of place and kind of insulting: if this book is for a seasoned programmer this is just going to trigger unpleasant flashbacks to arguments you had back when you were a junior programmer. If you're a new programmer and this stuff is news to you, other chapters in the book are going to be utterly incomprehensible to you.
Chapter 10, "The Beautiful Parts," is all of a page long, but a nice summary of the good aspects of the language.
Appendices A and B cover some of the "Awful & Bad Parts" of javascript in detail; this was the second-most interesting part of the book to me, though it's brief and you've picked it up if you read the rest of the book. Still, definitely value here. Though worth noting: he inserts some more editorializing here, ala Chapter 9 - he calls out some things that aren't specific to javascript, like switch statement fallthrough, as bad parts, which I found annoying. Stick to aspects unique to javascript and point out real dangers instead of offering advice on very broad aspects of coding style, I kept thinking.
Appendix C is about JSLint, the lint for javascript. It was useful only in the sense that I didn't know JSLint existed, and now I do, but then he gives a long swath of what amounts to JSLint documentation, which I have to imagine exists on the JSLint site, and felt like filler.
Appendix D is about JSON and just some reference information about the format. Maybe useful, but no authorial insight, just docs.
Overall, glad I read it, but I was pretty underwhelmed given the generally great reviews of the book on here.
I do not understand the majority of complaints. Some compare Crockford to "the most boring professor you ever had", others said the information was poorly organized and not written very well. Others complained about his ego getting in the way. I, for one, found it to be very interesting and useful. Parts of it were a struggle to get through (and I've been a C coder for 20+ years) but mental challenges are a software engineer's specialty.
In my opinion, none of the complaints are completely true, assuming you are the right audience. This book is NOT for beginners. If you are relatively new to Javascript, it will definitely be useful, but if you are new to programming entirely, this book is not for you. This is a more academic book that gives you a peek behind the scenes to the inner workings of the Javascript language. It is more comparable to K&R's book for C Programmers, but not as complete (just the "good" and "awful" parts!).
It is a book about the Javascript LANGUAGE. It is NOT a book on web programming. It will NOT teach you anything about HTML, or the DOM, or how to put little fiddlly-bits on the screen, or how to work out game physics, or how to use any HTML-specific components. It is a book on the constructs of Javascript, plain and simple. It should NEVER be the only book on Javascript you would own, but if you are serious about Javascript, it should definitely be in your library. I don't think you can be a Javascript master without this book.
My minor grievances are mostly limited to subjective areas where I disagree with him:
1) He states his opinion absolutely, more so in the first part of the book. I prefer a less forceful approach that presents the arguments and lets you decide for yourself. However, I do not feel he went overboard in this regard as some did - I suspect they didn't get very far into the book.
2) While I completely understand the Javascript bugaboo that makes a case for mis-aligned curly braces (K&R style). I cannot get myself to follow this convention (except in a few areas where I make exceptions) To me, code is SO much easier to follow when all blocks are aligned. I will heed his advice and avoid the lurking JS bug, but I will not fully convert to misaligned braces. I resent that his JSLint tool generates hundreds of errors in my code because of this - but fortunately, there's an option to turn it off.
3) When he digs into some of the JS-specific patterns that aren't familiar to non-JS programmers, I wish he would add a disclaimer along the lines of "while this is a powerful tool, understand that depending on such patterns may make the code more difficult to maintain by others less trained in the specifics of Javascript. Or at least comment vigorously." I am a firm believer in "clarity over cleverness" in shared code.
4) In some of the trickier subjects, a few more examples would makes things easier to comprehend. I've never really used Regular Expressions before, and the chapter left my head swimming, and I felt the explanation of the various components of the expressions could have been better.
But these are not major grievances, and I whole-heartily recommend this book for the intermediate Javascript user or the novice JS user who has a solid background in general programming language constructs.
Top reviews from other countries
This book was written in 2008 and probably needs updating. It’s hard going in places and the diagrams did little to nothing to help my understanding. I’ve come away still wondering about new and constructors, but I know I just need to review them again when I need them and it’ll get clearer. I’m still not sure which function declaration syntax is best, but I’m not sure it matters too much.
I bought this book and 2 others "Javascript the definitive guide" & "Javascript Patterns", as far as I am concerned these books are essential reading for any programmer!
These 3 books hold, the dubious honour, of being the only 3 programming books I have actually read cover to cover.
This book, is great, as I initally skim read this book over a lazy saturday afternoon, while drinking beer while sitting in sun lounger. Not something I often associate with tech books! I also watched some of the Douglas Crockfords videos on YouTube, which are great addendums, and a must.
I have re-read this book several times since, as I my journey into Javascript has progressed. The trilogy of javascript books has not left my Desktop, and I find myself refering to them time and again!
Douglas Crockfords style and approach to this book is just right! Easy to follow, and for a tech book a real page turner.
I suggest for real JavaScript beginners that they also check out the online Yahoo videos of Douglas Crockford's talks to help put the book into perspective and help provide greater detail of how JavaScript is different from other programming languages.









