JavaScript: The Good Parts

JavaScript: The Good Parts
By Douglas Crockford

List Price: $29.99
Price: $19.50 Details

Availability: Usually ships in 24 hours
Ships from and sold by

108 new or used available from $8.00

Average customer review:
(571 customer 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.

Product Details

  • Amazon Sales Rank: #24938 in Books
  • Brand: imusti
  • Published on: 2008-05
  • Original language: English
  • Number of items: 1
  • Dimensions: 9.19" h x .38" w x 7.00" l, .64 pounds
  • Binding: Paperback
  • 176 pages


  • O Reilly Media

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.

Customer Reviews

Most helpful customer reviews

601 of 614 people found the following review helpful.
5Wish I had this book when I first started Javascript
By Frodo Baggins
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

2 of 2 people found the following review helpful.
5Opened My Eyes To JavaScript
By Sean Y. Chou
Like many old-school Programmers (with capital P), I always felt JavaScript was a "messy" language with horrible browser implementations and poorly planned, incompatible DOMs. I knew enough of it to get by - but just barely so. But I first began to reconsider my position when I saw projects like jQuery and their elegant solutions. It got me interested enough that I decided it was time to get better informed about "modern day" JavaScript.

Well, this book completely turned me around on the language. It not only sold me on the idea that JavaScript can be treated as a serious language, but also on the idea that it's actually better suited for a variety of tasks. JavaScript can be elegant and powerful in ways that more traditional languages can't. The beauty of this book is that it argues the case by creating a subset of JavaScript through selective use of features and voluntary syntax conventions. This book also manages to do it simply and concisely, eschewing the usual introductory, filler type stuff found in most programming books. It jumps into the meat and goes through it so fast, I read it in two relatively short sittings. And I've re-read it on occasion just as a refresher which is something I can say of very, very few technical books.

I highly recommend this book for anyone who works with JavaScript or is considering it. I'd also recommend it to those steeped in traditional, compile-time focused, OO languages as a way to understand the power of a more dynamic language. In fact, given how short it is, I'd really recommend it to any programmer regardless of their current or past language of choice.

1 of 1 people found the following review helpful.
5One of the most important Javascript books ever written
By Roger Pence
Let's be clear, this book doesn't cover jQuery nor was it written by the author of CSS: The Missing Manual. This book is also not about Ajax or Web programming. It's about how to take your understanding of JavaScript up several notches. The preface clearly says this book isn't for beginners and also warns it may take multiple warnings to understand.

Don't let the silly negative reviews fool you, any serious JavaScript developer should own this book. It is certainly one of the most important JavaScript books ever written. It will make your JavaScript better.

See all 571 customer reviews...

Connect with defaultLogic
What We've Done
Led Digital Marketing Efforts of Top 500 e-Retailers.
Worked with Top Brands at Leading Agencies.
Successfully Managed Over $50 million in Digital Ad Spend.
Developed Strategies and Processes that Enabled Brands to Grow During an Economic Downturn.
Taught Advanced Internet Marketing Strategies at the graduate level.

Manage research, learning and skills at defaultLogic. Create an account using LinkedIn or facebook to manage and organize your IT knowledge. defaultLogic works like a shopping cart for information -- helping you to save, discuss and share.

  Contact Us