Join Amazon Prime and ship Two-Day for free and Overnight for $3.99. Already a member? Sign in.
JavaScript: The Good Parts and over 300,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.
 
   
More Buying Choices
49 used & new from $14.22

Have one to sell? Sell yours here
 
   
JavaScript: The Good Parts
 
 
Start reading JavaScript: The Good Parts on your Kindle in under a minute.

Don’t have a Kindle? Get yours here.
 
  
4.2 out of 5 stars See all reviews (48 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%)
In Stock.
Ships from and sold by Amazon.com. Gift-wrap available.

Want it delivered Wednesday, July 8? Choose One-Day Shipping at checkout. Details
34 new from $16.05 15 used from $14.22
Also Available in: List Price: Our Price: Other Offers:
Kindle Edition (Kindle Book) $14.39
Paperback Order it used!
Digital (Download: PDF) $23.99 $23.99
Like this book? Find similar titles from O'Reilly and Partners in our 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: $45.05

Customers Who Bought This Item Also Bought

JavaScript: The Definitive Guide

JavaScript: The Definitive Guide

by David Flanagan
4.4 out of 5 stars (286)  $31.49
jQuery in Action

jQuery in Action

by Bear Bibeault
4.4 out of 5 stars (41)  $26.39
High Performance Web Sites: Essential Knowledge for Front-End Engineers

High Performance Web Sites: Essential Knowledge for Front-End Engineers

by Steve Souders
4.4 out of 5 stars (37)  $19.79
Pro JavaScript Techniques

Pro JavaScript Techniques

by John Resig
4.3 out of 5 stars (24)  $36.51
RESTful Web Services

RESTful Web Services

by Leonard Richardson
4.4 out of 5 stars (37)  $26.39
Explore similar items

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


Inside This Book (learn more)

What Do Customers Ultimately Buy After Viewing This Item?


Tags Customers Associate with This Product

 (What's this?)
Click on a tag to find related items, discussions, and people.
Check the boxes next to the tags you consider relevant or enter your own tags in the field below.
(16)
(8)
(3)

Your tags: Add your first tag
 
Help others find this product — tag it for Amazon search
No one has tagged this product for Amazon search yet. Why not be the first to suggest a search for which it should appear?

 

Customer Reviews

48 Reviews
5 star:
 (29)
4 star:
 (6)
3 star:
 (6)
2 star:
 (7)
1 star:    (0)
 
 
 
 
 
Average Customer Review
4.2 out of 5 stars (48 customer reviews)
 
 
 
 
Share your thoughts with other customers:
Most Helpful Customer Reviews

 
78 of 80 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
Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)



 
37 of 39 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
  
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.
Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)



 
74 of 91 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.
Comment Comments (3) | Permalink | Was this review helpful to you? Yes No (Report this)


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

5.0 out of 5 stars Fantastic Best Practice Guide
David Flanagan's "Javascript: The Definitive Guide" has long been an essential resource. This book is the missing chapter from the definitive guide, a short best practices guide... Read more
Published 4 days ago by Chris van Hasselt

4.0 out of 5 stars Good Book
This book is excellent if you are already programming with any other language and want to get in to JS. In explains the basics with very good examples!
Published 6 days ago by C. Dumont

4.0 out of 5 stars Effective JavaScript
I would recommend you think of this book as the JavaScript equivalent of Effective Java (2nd Edition) (Java Series) or Effective C++: 55 Specific Ways to Improve Your Programs and... Read more
Published 20 days ago by Bradford C. Smith

2.0 out of 5 stars Pompous
If you are looking for real-world examples of how to put JavaScript to work, this is not your book. Some of the information is useful, but to little to justify the price of the... Read more
Published 1 month ago by M. Tomich

5.0 out of 5 stars Learning JavaScript
A must read for any web-developer. Having worked with JavaScript for a number of years in an ad-hoc fashion (AJAX, Firefox extensions, etc), this book has finally brought me the... Read more
Published 1 month ago by Ilya Grigorik

4.0 out of 5 stars Good Book. Well worth the price.
JavaScript: The Good Parts, is a concise, well written JavaScript guide intended for JavaScript developers with some degree of experience, and familiarity with the language. Read more
Published 1 month ago by Nicholas Salvadore

3.0 out of 5 stars Not what I expected
I read the reviews of this book and others about JavaScript before I purchased this one. I'm late getting around to learning JS, but I figured that my knowledge of other... Read more
Published 2 months ago by Ray Depew

4.0 out of 5 stars Good compilation
This is a good compilation of javascript yes you can probably find all this information on the internet but it is always nice to know where the information is when you need it.
Published 3 months ago by C. Shurtliff

5.0 out of 5 stars Best book on JavaScript I have seen
JavaScript is a quirky language. Almost functional, sort of Object Oriented, C'ish style language, little bit of this, little bit of that. All around strange. Read more
Published 3 months ago by Christopher Brandsma

5.0 out of 5 stars Small, but dense
When it comes to JavaScript, Douglas Crockford is "The Man". When it comes to browsers, JavaScript is "The Language". Read more
Published 4 months ago by Badotz

Only search this product's reviews



Customer Discussions

 Beta (What's this?)
New! See all customer communities, and bookmark your communities to keep track of them.
This product's forum (0 discussions)
  Discussion Replies Latest Post
  No discussions yet

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


Active discussions in related forums
  Discussion Replies Latest Post
C# or Java? 32 6 hours ago
Does anyone use Discovering Geometry: An Investigative Approach? 3 7 days ago
Textbooks for Kindle DX? 31 10 days ago
   


Product Information from the Amapedia Community

Beta (What's this?)



Look for Similar Items by Category


Discover Oregon

Garmin Oregon at Amazon.com
You'll find that on the trail, the new Garmin Oregons exchange waypoints, tracks, and geocaches with other Oregon and Colorado units.

Shop all Garmin

 

Big Savings in Books

Bargain Books
Find great titles at fantastic prices in our Bargain Books Store.
 

Cut Wood Down to Size

Cut Wood Down to Size

Split wood with ease using a log splitter from the Outdoor Power & Lawn Equipment Store.

Shop all log splitters

 

Best Books

Best of the Month
See our editors' picks and more of the best new books on our Best of the Month page.
 

 

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.


Where's My Stuff?

Shipping & Returns

Need Help?

Your Recent History

  (What's this?)
You have no recently viewed items or searches.

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

Look to the right column to find helpful suggestions for your shopping session.

Continue shopping: Top Sellers
Paranoia
Paranoia by Joseph Finder
Glenn Beck's Common Sense
Glenn Beck's Common Sense
Darkfever
Darkfever by Karen Marie Moning

Conditions of Use | Privacy Notice © 1996-2009, Amazon.com, Inc. or its affiliates