JavaScript: The Good Parts and over 450,000 other books are available for Amazon Kindle – Amazon’s new wireless reading device. Learn more

 

or
Sign in to turn on 1-Click ordering.
 
 
Express Checkout with PayPhrase
What's this? | Create PayPhrase
More Buying Choices
52 used & new from $15.42

Have one to sell? Sell yours here

or

Get a $8.25 Amazon.com Gift Card
 
   
JavaScript: The Good Parts
 
 
Start reading JavaScript: The Good Parts on your Kindle in under a minute.

Don’t have a Kindle? Get your Kindle here.
4.1 out of 5 stars  See all reviews (58 customer reviews)

List Price: $29.99
Price: $19.79 & eligible for FREE Super Saver Shipping on orders over $25. Details
You Save: $10.20 (34%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
In Stock.
Ships from and sold by Amazon.com. Gift-wrap available.

Want it delivered Friday, March 19? Choose One-Day Shipping at checkout. Details
37 new from $17.70 15 used from $15.42

Formats

Amazon Price New from Used from
Kindle Edition $14.39  
Paperback $19.79  
Like this book? Find similar titles in the O'Reilly Bookstore.

Best Value

Buy JavaScript: The Good Parts and get Essential Silverlight 2 Up-to-Date at an additional 5% off Amazon.com's everyday low price.

JavaScript: The Good Parts + Essential Silverlight 2 Up-to-Date
Buy Together Today: $41.73

Show availability and shipping details

  • This item: JavaScript: The Good Parts

    In Stock.
    Ships from and sold by Amazon.com.
    Eligible for FREE Super Saver Shipping on orders over $25. Details

  • Essential Silverlight 2 Up-to-Date

    In Stock.
    Ships from and sold by Amazon.com.
    Eligible for FREE Super Saver Shipping on orders over $25. Details


Customers Who Bought This Item Also Bought


Editorial Reviews

Product 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, 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.

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


More About the Author

Douglas Crockford
Discover books, learn about writers, read author blogs, and more.

Visit Amazon's Douglas Crockford Page

Inside This Book (learn more)


Tags Customers Associate with This Product

 (What's this?)
Click on a tag to find related items, discussions, and people.
 
(21)
(10)
(4)

Your tags: Add your first tag
 

 

Customer Reviews

58 Reviews
5 star:
 (34)
4 star:
 (8)
3 star:
 (8)
2 star:
 (6)
1 star:
 (2)
 
 
 
 
 
Average Customer Review
4.1 out of 5 stars (58 customer reviews)
 
 
 
 
Share your thoughts with other customers:
Most Helpful Customer Reviews

 
131 of 133 people found the following review helpful:
5.0 out of 5 stars Wish I had this book when I first started Javascript, June 27, 2008
By Frodo Baggins (Wisconsin, United States) - See all my reviews
Do you struggle when creating objects in Javascript?
Do you find the syntax to be non-intuitive and frustrating?
Do you know the difference between using a function as an object vs using an object literal?
Do you know how using object literals can simplify your code and create something similar to namespaces?
Do you know how to augment the type system -- for example, if wanted all strings to have a trim() method?
Do you know why the "new" statement is so dangerous? Do you know an alternative that eliminates the use of "new" entirely?

These are some of the topics that the book touches upon.

This book is aimed at someone with intermediate programming experience that wants to know the best way to create and use objects, arrays, types, etc. Crockford takes his experience with Javascript to show you best practices coding techniques and styles to use with Javascript. In addition, the book provides insights into what makes Javascript so confusing and what can be done about it.

You might ask "Isn't this stuff already covered in other books that I have?" The answer is no. For one, most other books use a psuedo-classical coding style (see below) to explain objects that is a source of confusion.

Javascript can be very confusing, especially for programmers who have extensive experience in other C-based languages (like myself). Writing good Javascript that uses objects, methods, etc. is hard. In Javascript, if you want to create objects, use inheritance and create methods, you have several different ways to write your code and it's difficult to know what the strengths and weaknesses of each are.

Crockford explains the problem plainly. Other C-based languages use class inheritance (Crockford calls this classical inheritance). Javascript, on the other hand, is the only popular language that uses prototype inheritance, which does not have classes. However, the syntax which Javascript uses to create object is Java-like (Crockford calls this pseudo-classical syntax). It's confusing, because it keeps you in a class-based frame of mind while working in a language that has no concept of classes.

Clarifying what's going on with the object model is the best part of this book. Crockford also explains other parts of Javascript that can be problematic and the techniques that he prefers for handling them. I don't necessarily agree with all of them, but the important thing is that he explains his reasoning.

To effectively learn Javascript, I recommend that you buy 1) a book that covers the details of the language and can be used as a reference (e.g. Javascript, the Definitive Guide) and 2) Crockford's book. Advanced programmers might also enjoy Pro Javascript Design Patterns, which shows a number of ways to combine Javascript with some of the GoF patterns. I would avoid any cookbook style books on Javascript, because you're better off using YUI, JQuery or one of the other Javascript libraries than writing your own drag-and-drops, calendars, etc.

There are a series of Yahoo! videos by Crockford that mirror the material in this book and can be found as podcasts under YUI Theater. They contain nearly all of the material in the book and probably a little more. Those videos are:

- Douglas Crockford/An Inconvenient API: The Theory of the DOM (3 parts)
- Douglas Crockford/The JavaScript Programming Language (4 parts)
- Douglas Crockford/Advanced JavaScript (3 parts)
- Douglas Crockford/Javascript The Good Parts
Help other customers find the most helpful reviews  
Was this review helpful to you? Yes No


 
46 of 50 people found the following review helpful:
5.0 out of 5 stars Beautiful book, May 16, 2008
By Ask Bjørn Hansen (Los Angeles, CA, United States) - See all my reviews
(VINE VOICE)   
Amazon Verified Purchase(What's this?)
This is a beautiful book.

First of all - at only 170 pages it is short. Even though some of the key points are repeated through the book it's dense with information. You don't need any JavaScript experience, but it's not a "beginning programming" book so if you haven't been programming before this is not the right book for you.

Reading this book a couple of times will give you an appreciation for the JavaScript language that you almost certainly didn't have before. It'll give you tools to write better programs that you and others will actually be able to maintain over time.

I've learned lots of little things that I maybe knew from experience, but now I _know_ and I know why.

This book will help you battle with JavaScript rather than against it.
Help other customers find the most helpful reviews  
Was this review helpful to you? Yes No


 
108 of 135 people found the following review helpful:
3.0 out of 5 stars JavaScript: The Pretty Good Book, June 14, 2008
By Jay Link (Illinois) - See all my reviews
(REAL NAME)   
I'm not sure what I thought this book would be; I guess I assumed it would be along the lines of "C Traps and Pitfalls". At times, however, it seems almost more like an essay.

Certainly, parts of the book are worth five stars. I was especially pleased to see the author's treatment of how null, undefined, and NaN all relate to one another in unexpected ways -- something that has puzzled me in the past. It was also good to see a list of the reserved keywords, some of which I didn't know before, and concrete examples of the dangers of == and != versus === and !==.

An unexpected treat was to read his discussions on the technical aspects and slowness of arrays, bitwise operators, and "with" statements in JavaScript, and the origins of "switch" in FORTRAN IV, and JavaScript's similarity to Lisp, despite its outward resemblance to C.

It was also bemusing to see his example of "flight.equipment && flight.equipment.model" on page 21, as I also learned that same lesson while working on a flight-related application.

Yet, for the head Javascript guy at Yahoo, it seems that a few things are missing. For example, while he does say on page 80 that slice() creates a shallow copy of an array, he does not make it explicitly clear that array2 = array1 will effectively create a pointer, i.e., a copy by reference. To make a truly independent copy of an array, one needs array2 = array1.slice() (no arguments necessary). This caused me a day of frustration when I first learned it.

And was it not Yahoo themselves that determined that scripts should come at the end of a web page to improve load speed? Why is that not in here?

We also have nothing about compression techniques.

On the web, for free, one can read Andy King's superb 2003 article on "Optimizing JavaScript For Execution Speed". And most of the discussion on objects can be learned much more succinctly and with better examples from MDC's "Core JavaScript 1.5 Guide".

One can learn a lot about download optimization from Dean Edwards.

Chapter 4 (Functions) was good; Chapter 2 (Grammar) did nothing for me.

I was also a little disappointed with Appendix B, "The Bad Parts". Most of this dealt with undisciplined programming as opposed to flaws with the language itself. E.g., "switch" statement fall-throughs are bad. Are they? If one of your people creates an unintentional fall-through, then deal with him; don't blame the language. Does Crockford also believe that firearms should be banned because of the potential of misuse, even though they have a valid purpose? How about steak knives? This is kind of like Edsger W. Dijkstra telling us that we can never use GOTO, even though it does have its place.

Further, I've used "continue" statements effectively, albeit not so often. Maybe I'm a bad programmer?

And then, he advises against autoincrements!! (++)

Regarding style, the book is definitely filled with the usual O'Reilly collegiate pompousness that's often good, sometimes not-so-good.

In summary, there are some good parts, but as a whole this is yet another pricey programming book from which I only needed 10 pages.

If you're at the plateau of understanding that it's actually the DOM that's slow and inefficient, and that Javascript is only guilty by association, and that it's actually an elegant little language, then there's probably something in this book for you.
Help other customers find the most helpful reviews  
Was this review helpful to you? Yes No

Share your thoughts with other customers: Create your own review
 
 
 
Most Recent Customer Reviews

4.0 out of 5 stars A good book on JavaScript
A very good introduction to JavaScript. It only deals with the language itself, and doesn't worry about DOM scripting or implementation details and inconsistencies in different... Read more
Published 16 days ago by Alexey Romanov

4.0 out of 5 stars Worth it for Intermediate JS Programmers
The reader of "JavaScript: The Good Parts" by Douglas Crockford will get a very good idea of why JavaScript is considered a runt among programming languages. Read more
Published 1 month ago by Mitchell C. Amiano

5.0 out of 5 stars Required reading for JavaScript developers
This is the first book anyone touching JavaScript must read. Learning JavaScript from any other source (book or website) will teach you bad habits that will be difficult to break... Read more
Published 2 months ago by Lawrence Kesteloot

5.0 out of 5 stars The True Clues om JavaScript
I was reading Coders at Work and came to the chapter on Doug Crockford. I was impressed enough to put the book down and order this one. Read more
Published 2 months ago by David Casseres

5.0 out of 5 stars Unique Approach
I love this book. Mr. Crockford covers a ton of very usable information in a relatively small volume. Read more
Published 4 months ago by Dragon_71

3.0 out of 5 stars A few gems, but too much filler
This book has some good parts, even some great parts. Many parts of Chapters 3, 4, and 5 are very insightful, and might revolutionize how you think about Javascript, even... Read more
Published 4 months ago by J. Croisant

1.0 out of 5 stars High hopes, Sad reality
Abstracted from the Preface:

"intended for programmers who, by happenstance or curiosity, are venturing into JavaScript for the first time" 1

"This is... Read more
Published 4 months ago by Rex Pebble the II

3.0 out of 5 stars Material is good, but author attitude is not
I'm new to javascript and wanted a book just to get me started. I figured this book was as good of a starting point as any. Read more
Published 4 months ago by S. Carr

1.0 out of 5 stars Repetitive, opinionated, and cranky
Short but repetitious. A bad combination. Majorly disappointed by this one.

First of all, it's not really a JavaScript book - much of the advice offered is very... Read more
Published 5 months ago by BillyJoeBob

5.0 out of 5 stars Sound advice on coding to Javascript's strengths rather than fighting them
This book is another in the series of books lately reclaiming Javascript as a powerful language that hasn't gotten it's due (see Stefanov's book for another good example)... Read more
Published 5 months ago by Y. Maman

Only search this product's reviews



Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 


Active discussions in related forums
Search Customer Discussions
Search all Amazon discussions
   



So You'd Like to...


Create a guide

Product Information from the Amapedia Community

Beta (What's this?)


Look for Similar Items by Category


Look for Similar Items by Subject

 

Feedback

If you need help or have a question for Customer Service, contact us.
 Would you like to update product info or give feedback on images?
Is there any other feedback you would like to provide?

Your comments can help make our site better for everyone.


Your Recent History

 (What's this?)

After viewing product detail pages or search results, look here to find an easy way to navigate back to pages you are interested in.