JavaScript: The Good Parts

JavaScript: The Good Parts
by Douglas Crockford

JavaScript: The Good Parts
List Price: $29.99
Our Price: $16.55
You Save: $13.44 (45%)
Availability: Usually ships in 1-2 business days
Buy Used: from $13.83 (click here)
Category: Book
See more book details and other editions


or

Book Summary Information

Author: Douglas Crockford
Edition: Paperback
Audio: English (Unknown); English (Original Language); English (Published)
Published: 2008-05
ISBN: 0596517742
Number of pages: 176
Publisher: Yahoo Press

Book Reviews of JavaScript: The Good Parts

Book Review: Wish I had this book when I first started Javascript
Summary: 5 Stars

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

Summary of JavaScript: The Good Parts

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.

Languages & Tools Books

Book Subjects
Most talked about in Languages & Tools Books
Eclipse Plug-ins (3rd Edition) ImageEclipse Plug-ins (3rd Edition)
by Eric Clayberg, Dan Rubel
Addison-Wesley Professional; Published: 2008-12-21; Paperback; Book
Best price: $38.33
Price in other shops: $59.99
Java Software Solutions: Foundations of Program Design (6th Edition) ImageJava Software Solutions: Foundations of Program Design (6th Edition)
by John Lewis, William Loftus
Addison Wesley; Published: 2008-03-07; Paperback; Book
Best price: $74.40
Price in other shops: $128.00
C++ Primer (3rd Edition) ImageC++ Primer (3rd Edition)
by Stanley B. Lippman, Josée Lajoie
Addison-Wesley Professional; Published: 1998-04-02; Paperback; Book
Best price: $14.47
Price in other shops: $49.99
Accelerated C++: Practical Programming by Example ImageAccelerated C++: Practical Programming by Example
by Andrew Koenig, Barbara E. Moo
Addison-Wesley Professional; Published: 2000-08-24; Paperback; Book
Best price: $26.99
Price in other shops: $49.99
Patterns of Software: Tales from the Software Community ImagePatterns of Software: Tales from the Software Community
by Richard P. Gabriel
Oxford University Press, USA; Published: 1998-05-28; Paperback; Book
Best price: $64.55
Just Java? 2 (6th Edition) ImageJust Java? 2 (6th Edition)
by Peter van der Linden
Prentice Hall; Published: 2004-07-01; Paperback; Book
Best price: $35.00
Price in other shops: $64.99
UML for Java? Programmers ImageUML for Java? Programmers
by Robert C. Martin
Prentice Hall; Published: 2003-06-06; Paperback; Book
Best price: $15.00
Price in other shops: $44.99
Thinking in Java (3rd Edition) (One-Off) ImageThinking in Java (3rd Edition) (One-Off)
by Bruce Eckel
Prentice Hall PTR; Published: 2002-12-06; Paperback; Book
Best price: $13.80
Price in other shops: $54.99
SQL Fundamentals with CDROM ImageSQL Fundamentals with CDROM
by John J. Patrick
Prentice Hall; Published: 1999-05-11; Paperback; Book
Best price: $12.00
Price in other shops: $44.99
C How to Program, 2nd Edition ImageC How to Program, 2nd Edition
by Paul J. Deitel
Prentice Hall; Published: 1994-01-13; Textbook Binding; Book
Best price: $29.86
Price in other shops: $70.00
Similar Books and other products
The Book of CSS3: A Developer's Guide to the Future of Web Design ImageThe Book of CSS3: A Developer's Guide to the Future of Web Design
by Peter Gasston
No Starch Press; Published: 2011-05-13; Paperback; Book
Best price: $19.47
Price in other shops: $34.95
jQuery Pocket Reference ImagejQuery Pocket Reference
by David Flanagan
O'Reilly Media; Published: 2011-01-04; Paperback; Book
Best price: $6.80
Price in other shops: $12.99
Supercharged JavaScript Graphics: with HTML5 canvas, jQuery, and More ImageSupercharged JavaScript Graphics: with HTML5 canvas, jQuery, and More
by Raffaele Cecco
O'Reilly Media; Published: 2011-08-02; Paperback; Book
Best price: $19.57
Price in other shops: $39.99
jQuery in Action, Second Edition ImagejQuery in Action, Second Edition
by Bear Bibeault, Yehuda Katz
Manning Publications; Published: 2010-07-05; Paperback; Book
Best price: $23.95
Price in other shops: $44.99
Eloquent JavaScript: A Modern Introduction to Programming ImageEloquent JavaScript: A Modern Introduction to Programming
by Marijn Haverbeke
No Starch Press; Published: 2011-02-03; Paperback; Book
Best price: $16.99
Price in other shops: $29.95
jQuery Cookbook: Solutions & Examples for jQuery Developers (Animal Guide) ImagejQuery Cookbook: Solutions & Examples for jQuery Developers (Animal Guide)
O'Reilly Media; Published: 2009-12-03; Paperback; Book
Best price: $17.40
Price in other shops: $34.99
High Performance JavaScript (Build Faster Web Application Interfaces) ImageHigh Performance JavaScript (Build Faster Web Application Interfaces)
by Nicholas C. Zakas
Yahoo Press; Published: 2010-03-30; Paperback; Book
Best price: $19.50
Price in other shops: $34.99
JavaScript Web Applications ImageJavaScript Web Applications
by Alex MacCaw
O'Reilly Media; Published: 2011-08-30; Paperback; Book
Best price: $19.88
Price in other shops: $34.99
JavaScript Patterns ImageJavaScript Patterns
by Stoyan Stefanov
O'Reilly Media; Published: 2010-09-28; Paperback; Book
Best price: $16.00
Price in other shops: $29.99
JavaScript: The Definitive Guide: Activate Your Web Pages (Definitive Guides) ImageJavaScript: The Definitive Guide: Activate Your Web Pages (Definitive Guides)
by David Flanagan
O'Reilly Media; Published: 2011-05-10; Paperback; Book
Best price: $30.99
Price in other shops: $49.99