Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Overview

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.

Subscriber Reviews

Average Rating: 4.568627450980392 out of 5 rating Based on 51 Ratings

"Changed the way I write software" - by Bruce Van Horn on 13-MAY-2013
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
I'm sure others have said it already.  If you don't know javascript, start with this book and ignore the others as they will only lead you astray.  I've been able to take the ideas I learned from Crockfordian JavaScript to make me a more adept C# programmer and a better teacher.
Report as Inappropriate

"Classic" - by Tello on 30-JUN-2012
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
Douglas puts together in a clear voice the good parts of JavaScript.  For anyone serious about JavaScript and using it in their career should read this book.  You will find that your time was well spent.
Report as Inappropriate

"Probably the best programming book I've ever read" - by mfdj on 11-JUN-2012
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
You'll love this book if you're like me and have a solid grounding in strictly-typed, more formal language (Actionscript 3) and always struggled with the weird scoping and prototype inheritance model.

Mr. Cockford's overview of the language is kind of a monumental achievement. By choosing to discuss the language in terms of good and bad it's easy to focus on the meaningful grammar and useful aspects of javascript and not get bogged down in the ugly. Too many books just regurgitate the language spec with examples.

With that brevity comes an understanding that the reader understands programming concepts, OOP, and some basic design patterns. It's for taking your muddled novice skills to the next level.

Report as Inappropriate

"JavaScript: The Good Parts" - by mitchellm44 on 10-MAR-2012
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
In looking over the reviews that indicated this book to be "poorly written" - make me think that the commenters might not have been hit with the descrepancies in the language (yet).

I have seen this book as a book that MUST be read by anyone who want to be proficient in JavaScript - there are nuances to this language that you might not understand on a first take - especially coming from a "similar" syntax language (which I did).

I saw the Google TechTalk video, where Doug Crockford put up a slide on the way you use curly-brackets in JavaScript can cause you to not even see an error - if you put your brackets under the function - you lose - if you put your bracket to the right of the function - you got it right. If you dont understand that the implied semicolon occurs when you dont, and your error goes unreported - you will fight with your confusion for more time than you would need to - if you had read this book - and understood it.

This should be required reading for anyone thinking of serious web development in the 2nd decade of the 21st centure. Before the 21st century - I am not sure that the understanding of this language had matured enough to grok the differences. Please learn the language correctly and don't assume you know.

Using the jslint functions wil help you understand this even more.

Your programming of this language will only improve as you understand the pitfalls of this language - and use it to solve real problems - the right way - described here.

Report as Inappropriate

"Enlightening" - by Patrick Roumanoff on 25-MAR-2011
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
This excellent book made me discover javascript even though I have been "using" the langage for more than 10 years I discovered I didn't know the first thing about it.

it is short, concise and very informative.

Report as Inappropriate

Table of Contents

 Index

Extras

The publisher has provided additional content related to this title.


Description
Content

Visit the catalog page for JavaScript: The Good Parts

  • Catalog Page

Visit the errata page for JavaScript: The Good Parts

  • Errata

Download the supplemental electronic content for JavaScript: The Good Parts

  • Supplemental Content