JavaScript: The Good Parts and over 670,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
Have one to sell? Sell yours here
or
Get a $7.51 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, or download a FREE Kindle Reading App.

JavaScript: The Good Parts [Paperback]

Douglas Crockford (Author)
4.2 out of 5 stars  See all reviews (69 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, September 3? Choose One-Day Shipping at checkout. Details
37 new from $16.92 15 used from $12.50
Textbook StudentJoin Amazon Student and get FREE Two-Day Shipping for one year with Amazon Prime shipping benefits.

Formats

Amazon Price New from Used from
Kindle Edition $14.39  
Paperback $19.79  
Sell This Book Back for $7.51
Whether you buy it used on Amazon for $12.50 or somewhere else, you can sell it back to our Textbook Buyback Store at the current price of $7.51 through December 31, 2010. Restrictions Apply
Used Price$12.50
Buyback Price$7.51
Price after
Buyback
$4.99

Special Offers and Product Promotions


Frequently Bought Together

JavaScript: The Good Parts + JavaScript: The Definitive Guide + jQuery Cookbook: Solutions & Examples for jQuery Developers (Animal Guide)
Price For All Three: $74.37

Show availability and shipping details

Buy the selected items together
  • In Stock.
    Ships from and sold by Amazon.com.
    Eligible for FREE Super Saver Shipping on orders over $25. Details

  • JavaScript: The Definitive Guide$31.49

    In Stock.
    Ships from and sold by Amazon.com.
    This item ships for FREE with Super Saver Shipping. Details

  • jQuery Cookbook: Solutions & Examples for jQuery Developers (Animal Guide)$23.09

    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)

What Do Customers Ultimately Buy After Viewing This Item?

JavaScript: The Good Parts
83% buy the item featured on this page:
JavaScript: The Good Parts 4.2 out of 5 stars (69)
$19.79
JavaScript: The Definitive Guide
8% buy
JavaScript: The Definitive Guide 4.4 out of 5 stars (295)
$31.49
Murach's JavaScript and DOM Scripting (Murach: Training & Reference)
3% buy
Murach's JavaScript and DOM Scripting (Murach: Training & Reference) 4.8 out of 5 stars (24)
$34.34
jQuery in Action, Second Edition
3% buy
jQuery in Action, Second Edition 4.3 out of 5 stars (56)
$29.69

Tags Customers Associate with This Product

 (What's this?)
Click on a tag to find related items, discussions, and people.
 
(24)
(13)
(6)

Your tags: Add your first tag
 

 

Customer Reviews

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

 
173 of 176 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
This review is from: JavaScript: The Good Parts (Paperback)
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


 
51 of 55 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 review is from: JavaScript: The Good Parts (Paperback)
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


 
124 of 158 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)   
This review is from: JavaScript: The Good Parts (Paperback)
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

5.0 out of 5 stars Great Javascript Book. Not for n00bs though.
Great book.

The material is relevant and concise. Perfect guide for someone who has programmed in other languages but wants to get into Javascript... Read more
Published 1 day ago by RYAN M LABOUVE

5.0 out of 5 stars One of the best JavaScript small references book
JavaScript: The Good Parts by Crockford is written to be a quick and small reference for the javascript programmer. Read more
Published 1 day ago by Ionel Condor

4.0 out of 5 stars Not a simple reading sometimes, but direct to the problem
You can be sidetracked from the tiny size of this book, but is not a simple reading. This is not for people that wanna learn Javascript from scratch, but for programmer who... Read more
Published 1 month ago by Luca

5.0 out of 5 stars Crockford's book will improve the web
I have tried to learn strong Javascript skills many, many times over more than a decade. My shelves are full of thick 'Bibles' on the topic. Read more
Published 1 month ago by Damien Sawyer

5.0 out of 5 stars Your personal guide for JavaScript's most difficult features
I found this book excellent in its descriptions of functions, methods, arrays, inheritance, and several other more abstract features of JavaScript. Read more
Published 1 month ago by psulover901

4.0 out of 5 stars Well written and knowledgeable
This is a good book so far. The author takes the view that Javascript is not really a great language, but we're stuck with it, which is how I feel. Read more
Published 1 month ago by N. Hannum

5.0 out of 5 stars It is the The Good Parts of JavaScript
Not for JavaScript entry level programers.
But if you know your JavaScript and you want to take it to the next level, this is a book fro you.
Published 2 months ago by Raanan Avidor

4.0 out of 5 stars Great for a programmer who needs to learn Javascript
The project I was just moved on to is a web based application we'll be building from the ground up. Many of us on the team don't have any Javascript experience, we all came from... Read more
Published 2 months ago by chumpus

1.0 out of 5 stars Appallingly bad book
A slim book that does little to encourage good JavaScript coding practices. OK, the JavaScript language is flawed as the title of the book implies, but the author defends one of... Read more
Published 3 months ago by C. Wareham

5.0 out of 5 stars Seminal book on JavaScript
It is no wonder this book gets some mixed reviews. In it lies the distilled knowledge of possibly more than a decade of improving JavaScript by someone who know it inside out. Read more
Published 4 months ago by Lucia M. Rotger

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


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.