| List Price: | |
| Price: | $23.99 & eligible for FREE Super Saver Shipping on orders over $25. Details... |
| You Save: | $0.00(0.00%) |
| Binding: | Kindle Edition |
| EAN: | |
| Feature: | |
| Label: | Yahoo Press |
| Publisher: | Yahoo Press |
| Studio: | Yahoo Press |
| Tags: |
Editorial Reviews
Related Reviews
Wish I had this book when I first started Javascript
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.
Serious JavaScript programming requires strong discipline
This book's size makes it approachable for all audiences, its style is terse and concise. This book has the potential to do for JavaScript, what Richie's inspirational classic the C Programming Language did for the C language.
JavaScript is the programming language of the web (AJAX), and this book will guide you through the good parts of this often misunderstood language - while this book is an excellent reference, it is not intended to replace JavaScript: The Definitive Guide, you'll do best to have both these books on hand.
If you enjoyed (or are considering) this book then you may want to hear more of what Douglas Crockford has to say, check out his great JavaScript video series on the YUI Theater.
Essential Read For Javascript Developers
This book is all about efficiency and cleanliness. Written by one of the main developers of JSON, this book is organized smartly and craftfully. I love the fact that there isn't bloat and it's very easy to get through this book in no time at all. Does that mean you aren't getting your money's worth with this book??? HELLS NO!!
If you want to improve your Javascript developing skillset you owe it to yourself to pick up this book, it's one of the best books on the market in this subject matter.
***** HIGHLY RECOMMENDED
A Great JavaScript Book for Everybody
His book JavaScript: the Good Parts, is a short (145 pages including Appendix) but is very useful for the person who wants to expand his/her JavaScript skills and knowledge. It reviews the basics of the language in the first two chapters and then focus on intermediate and advanced topics such as objects, inheritance, arrays, and methods.
The appendix categorizes the "bad" parts of JavaScript that are not good programming syntax and should be avoided such as global variables, scope, eval function, with statement, undefined variables and so forth.
I really like how Douglas Crockford gives you everything you need in this book that is relevant to how modern developers using JavaScript program and helping you understand it easily and quickly. No long-winded explanations or extra "filler" just to make the book longer. He is right to the point and explains it in a coherent, understandable way no matter what your "technical" level is.
This is a very useful book for the client-side developer who wants either a great reference book or somebody who wants to take their skills to the next level using JavaScript.
A must buy!
JavaScript: The Pretty Good Book
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.
Second best book on JavaScript
The book has a very specific focus, so do not be deceived into thinking this book covers the entire language. For information like that, Flanagan's JavaScript The Definitive Guide will be better. This book, however, is an excellent discussion of the important features of the language. Highly recommended.
Excellent way to become fluent in Javascript.
This book is possibly one of the best technical/programming related books I have had the pleasure of reading. It doesn't try to be a massive encyclopedic volume like most of my other technical books, so I didn't have to devote countless hours and days pushing through lengthy filler. Every section contains brief information about the most critical parts of Javascript you need to begin coding what you need right away in a tidy object-oriented fashion. If you have experience with any other C-based language and understand general OOP concepts, this book will make you fluent in Javascript with the least amount of time and effort on your part!
A few gems, but too much filler
Unfortunately, the book as a whole seems to suffer from an identity crisis, or a lack of effort by the author to craft a consistent work, or perhaps a struggle between the author and publisher. Whatever the cause, it seriously compromised the quality and integrity of what could have been an amazing book. Instead of the tome of grand enlightenment that it should have been, we are left with a few gems buried amidst mounds of useless filler material.
The introduction explains that this is not a book for beginners, which is true, because beginning programmers would find most of Chapters 3, 4, and 5 to be completely impenetrable. Even experienced programmers may find them difficult to grasp. As the introduction says, this book is "small but dense," which is a nicer way of saying that it throws advanced techniques and code samples at the reader without sufficient explanation.
The introduction also explains that this is not a reference book, which is also true, because it does not describe the DOM at all, nor even list all the standard methods and functions built into Javascript. The introduction suggests that the reader should go look on the internet to find such references, which you'll certainly need to do if you plan to actually use Javascript for anything. But despite it not claiming not to be a reference book, the author decided in Chapter 8 to present a mishmash of standard methods, without any clear reason for why some are listed and others omitted, nor even a mention of the fact that there are others you should be familiar with.
And even though it is not a reference book or a book for beginners, a significant chunk of the book is spent explaining very basic concepts that the target audience is undoubtedly already familiar with. For example, 14 pages are spent explaining the syntax for whitespace, numbers, strings, if statements, while loops, and so on, all of which will be nothing new to anyone who has used C, C++, Java, etc. The book even provides railroad diagrams to illustrate each syntax, which adds thickness but little value to the book, then repeats them in Appendix D to add another 10 pages of pure bulk.
There is a lot of other filler material, as well, such as the appendix on JSLint, which is a slightly more polished copy of the documentation [...], and the appendix on JSON, which is a slightly more polished copy of the documentation [...], both being pet projects of the author. Neither of these appendices adds value to the book, only thickness.
If Crockford and O'Reilly were interested in offering a really great book, or even a book worth the price tag, they should have cut the filler, expanded the explanations where they are needed, and offered more insights and substantial practical examples.
But I can't really recommend the book as it is now, unless you buy it used or borrow it from a library. You would be better off with a Javascript beginner's guide plus reference to learn the basics, or proper guide to functional programming (regardless of the programming language) to learn the advanced techniques.
Many of this book's topics are covered at Yahoo's "YUI Theater" in a collection of the author's lectures (http://developer.yahoo.com/yui/theater/ anything by Douglas Crockford). If you are interested in YUI at all, this book will help you understand the conventions used in YUI.
To paraphrase the author, if you want a book that teaches you how to be a horrible JavaScript programmer, get any other JavaScript book.
The book itself has its good and bad parts
While I liked the book, I think it was 'filled' with this juiceless chapter because it was already too short (around 145 pages).
I think reading Douglas online is a better deal! See: http://www.crockford.com/
Some good data, but scattered and inconsistent, unclear who it's written for.
My TL;DR version of the review: this book is a hodgepodge of different information about the language, but some of it is so complicated it'll go immediately over the heads of new programmers, and then some of it is so mundane (even pedantic, talking about very specific aspects of coding styles) it felt goofy and out of place. It seems to me that any specific individual reading this book won't really find more than one or two chapters very relevant. I give it 3 stars because the useful parts were useful to me, but I skimmed and ignored 80+% of the book.
Crockford's writing is personable and clear, and the book's organization is straightforward. Here's my chapter-by-chapter breakdown. Note that this is all from my perspective, what I personally found useful or not, but my point is, while other readers will certainly disagree with me about what was useful, I have trouble imagining any one person finding more than about 20% of the book useful.
Chapter 1 is an introduction and high-level explanation of the point of the book.
Chapter 2 covers basic grammar and the likes, which was helpful though it's not aimed at any particular familiarity with other languages so it's trying to be comprehensive, which meant that as an experienced programmer in other languages I had to skim it and just look for differences with what I'm already used to.
Chapters 3 and 4 were the most useful parts of the book for me: the section on objects and functions, data scoping and closure, which really takes a new way of thinking if, like me, you have a lot of experience with languages without closure and anonymous functions and the like. Crockford does a good job of explaining this and giving relevant examples. This section was 20% of the book and was the only section I found really useful.
Chapter 5 covers inheritance. He presents two methods, one using new and constructors like one of the languages I'm more used to, and gives a couple reasons to avoid this, and then digs into the prototypal method, which is unfamiliar to me. The problem is that he uses totally abstract examples here - classes representing animals and methods that return their names or the noises they make - and it was very hard for me to relate it to any actual application, and since the prototypal style is a fundamentally different paradigm I don't feel like I really grasped it from his writing. Since he builds a framework of extension methods throughout the book, once I started to lost his train of logic I was utterly lost. And the "meta" nature of javascript, assigning functions to methods that return other functions that wrap functions, I found it easy to get lost.
Chapter 6 covers arrays. If you've used scripting languages this stuff is very simplistic, a stark change from Chapter 5, which is quite sophisticated. Again, my point here - I don't know who would simultaneously understand Chapter 5 and still find anything in Chapter 6 useful.
Chapter 7 is a significant change of direction; it's a long chapter on regular expressions which I skimmed very quickly since I know them from using perl. This part seemed odd, since regular expressions are common to several languages, and there's nothing particularly unique about javascript's usage of them. It felt a bit misplaced in this book. Certainly they're an important part of the language, but again made me wonder: who's the book for?
Chapter 8 is a reference for core API functionality and his extension methods; this feels like stuff I'd just google while coding, not terribly valuable to me personally.
Chapter 9 is a diversion on coding style, and felt wildly out of place and kind of insulting: if this book is for a seasoned programmer this is just going to trigger unpleasant flashbacks to arguments you had back when you were a junior programmer. If you're a new programmer and this stuff is news to you, other chapters in the book are going to be utterly incomprehensible to you.
Chapter 10, "The Beautiful Parts," is all of a page long, but a nice summary of the good aspects of the language.
Appendices A and B cover some of the "Awful & Bad Parts" of javascript in detail; this was the second-most interesting part of the book to me, though it's brief and you've picked it up if you read the rest of the book. Still, definitely value here. Though worth noting: he inserts some more editorializing here, ala Chapter 9 - he calls out some things that aren't specific to javascript, like switch statement fallthrough, as bad parts, which I found annoying. Stick to aspects unique to javascript and point out real dangers instead of offering advice on very broad aspects of coding style, I kept thinking.
Appendix C is about JSLint, the lint for javascript. It was useful only in the sense that I didn't know JSLint existed, and now I do, but then he gives a long swath of what amounts to JSLint documentation, which I have to imagine exists on the JSLint site, and felt like filler.
Appendix D is about JSON and just some reference information about the format. Maybe useful, but no authorial insight, just docs.
Overall, glad I read it, but I was pretty underwhelmed given the generally great reviews of the book on here.
Great book, skip the first edition or have the errata page bookmarked
O'Reilly provides a good errata resource, but every other code example in this book has either a missing semicolon that you have to hunt for (most common) or code that is completely wrong. Perhaps none of this has been mentioned due to the strong merits of the content -- but it appears nobody even did a quick review over the code in this book! If you are going to buy this to have on your desk for years to come, buy it on PDF now and wait for the second edition print for the errata corrections.
With that said, I'm not trying to troll on this great book. I want to give a heads up to people so they don't have to work part-time as a copy-editor.
This slim volume contains the essence of the JavaScript language. It is not concerned with the inner workings of JavaScript, nor is it a "Learn JavaScript in a Fortnight" type of book. It is more a meta-JavaScript guide of style, pointing out features and usage not available elsewhere, except perhaps at his website, "Douglas Crockford's Wrrrld Wide Web" (http://www.crockford.com).
Those new to the language may find this book to be like James Joyce's "Ulysses" - that is, incomprehensible. The use of closures, self-reference and passing functions as parameters to other functions takes some time to grasp fully. The end result is worth the time invested: you will be a better programmer for having digested the information provided by Mr. Crockford. Heck, you will be a better programmer even if you don't grok everything put forth in the book.
As the inventor and promoter of JSON, short for "JavaScript Object Notation", Mr. Crockford deserves much praise. JSON is a data interchange format made up of a JavaScript object. There are implementations of JSON for many other languages (visit the aforementioned web site for details). While not strictly a replacement for XML, JSON is as readable, requires no external parser to implement and can be operated on directly in any browser that supports JavaScript, and the major ones do.
I must admit, I am an addicted JavaScript programmer. I found Douglas Crockford many years ago, and while he does not know me, he has mentored me and brought forth a deeper understanding of JavaScript that also applies to programming in general. Comments, the use of whitespace, blank lines; these are things not often found in a web application.
I strive to always be a Good Programmer, and when I find myself slipping into old, bad habits, now I have a book to lift my spirits and show me the way.
Yes, "JavaScript: The Good Parts" is that good.
At Long Last, A Serious Javascript Book
Douglas Crockford, who works at Yahoo, is unable to leave these questions in the realm of the intellectual, and he is in growing company. The era of large Javascript applications is upon us. By large, I mean applications that are mostly javascript, rather than HTML documents with a splash of code. This is more than mere AJAX. This is true application development, and with the scale must come application scale rigor.
It is to the problems of serious application developers that Crockford addresses the book. This is *not* an introductory book. It is generally assumed that the reader knows what the building blocks are.
Instead, Crockford focuses on issues such as organization, error avoidance, and writing code touched by many developers.
More importantly, Crockford expresses opinions. Technology as a field is never short on opinion, but technology books are a wasteland. Good luck finding a volume that spends much time at all criticizing its subject matter. Crockford pulls no punches. If he doesn't care for a given design decision, he says as much. It is, in a word, refreshing. Would that more books offered such candor.
Even if you disagree with Crockford's answers, the exercise of working through his arguments will teach you to ask better questions.
In exchange, you will learn about some of the more powerful but under-used aspects of Javascript, such as closures and first class functions. Furthermore, Crockford's detailed descriptions will give you clearer insight into exactly how the language really works.
In sum, Javascript: The Good Parts is the sort of book that can move you to the next level in your javascript development. Thank the gods the age of platonic, useless JS books is behind us.
Excellent Resource for JavaScript
For someone serious about JavaScript, there are two books to own. JavaScript: The Definitive Guide to learn the language and its syntax (in minute detail), and this book, to learn how to use the language well.
Finally, another good book about JavaScript
JavaScript: The Good Parts is well written and terse. I'm an experienced programmer, and have worked with JavaScript for some time now, so I don't know how well it would work for an amateur, but I suspect any programmer that has no JavaScript experience would do very well to read this book first and keep The Definitive Guide as a secondary reference, especially when reading someone else's JavaScript.
I rely heavily on the YUI libraries that Crockford's company puts out, and on Crockford's JSlint.com utility. Put together with the advice in this book, and JavaScript shines as a very nice language.
I thoroughly enjoyed reading it.
Good Book. Well worth the price.
In addition to looking at broad design of JavaScript programming, Crockford points out common mistakes and problems that plague even experienced web developers. This ranges from more complex problems like JavaScript's lack of tail recursion optimization, to the preferred ways of declaring simple arrays and objects. Things any developer can benefit from.
Perhaps the most beneficial aspect of this book are the fully coded functions used to demonstrate shortfalls of JavaScript. These functions, such as is_array(), isNumber(), and trim(), not only provide the reader with an excellent solution, but gives a solid understanding of why the problem exists, and more importantly, why is must be corrected.
Like all books, JavaScript: The Good Parts isn't without problems. While it provides an ample number of examples, some of the examples are overly condensed, and others seem incomplete.
Overall JavaScript: The Good Parts is a valuable book which I would recommend to anybody who wishes to get a deeper understanding of JavaScript, or simply just wants to write more efficient and more soundly structured code.
If, on the other hand, you're an experienced programmer who's just realizing that you need to get serious about JavaScript, this is a book you should have on your shelf next to the Rhino book by Flanagan. I've probably read mine about as much as the K&R book when I started on C.
A great introduction to JavaScript
JavaScript: The Good Parts is great at describing the great features in JavaScript and what 'features' aren't worth the pain they'll put you through. This book is not a JavaScript reference book.
It provides a framework for building JavaScript applications that avoid common problems. The author describes avoiding problems with global variables (by wrapping them in an object or function), inheritance, and other small but important pitfalls.
I'm definately satisfied with the purchase. My biggest wish is that it was longer and more in-depth, as it's obvious the author has a lot more great JavaScript advice to impart.
Sound advice on coding to Javascript's strengths rather than fighting them
I found chapter 5 on the inheritance techniques to be way harder than the other chapters in the book. But after digesting some of it, I proceeded on to the next chapters. They did not build on it so much as they were covering other domains of the language, so it's not a show stopper to understand the rest of what crockford is after to show you which are of course "the good parts" in the other domains (regular expressions, built in objects...). I return to the fifth chapter periodically to further understand everything that's going on there and pick up something else each time.
It was also nice to have the "avoid this" opinion sections entitled "awful parts" and "bad parts". While some may be disputable, it's good to get a heavyweight's reasons on why to avoid them if possible.
The code is usually light and nicely explained. The errata in the oreilly site patch up the few oopsies here and there. I feel definitely more energized to write prototype based Javascript and learn some Ajax libraries without being afraid to peak in at their source if need be now and then.
JavaScript - Beyond the Basic Parts
Like some of the other reviews, I might disagree with some of the suggestions based on how one uses JavaScript. For example, the author states that "Scope" is an awful part of the language. It could also be looked upon as a benefit to the language when the developer is looking to just build some extra code embedded within html. Some of the issues he brings up on reserved words can also be argued that most developers use common sense in picking variable names and wouldn't probably call a variable "method" even though you can in the language.
If you are already a confident Object Oriented developer or a well seasoned JavaScript developer then take a look at this book. If you are a rookie to the language or looking for a cookbook method of learning, I would suggest you look at some of the other JavaScript texts from O'Reilly.
Crockford's book will improve the web
The best bit about all this is that, "the best bits" of Javascript are actually pretty amazing! Deep in my head, by looking at others' work (Google!), I knew that a great language was hidden in there somewhere - but it always eluded me. Those days are finally over!! I can't wait for my next web project!!
I have read more computer books over the past thirty years than I can remember. Despite it's deceptively short length, this is one of the very best.
Best of all, "JavaScript: The Good Parts" will make you a better programmer. Just reading the book I've managed to spot at least half a dozen patterns and improvements to my own JavaScript code. Highly recommended.
half best-practices tutorial, half advice collection
All in all, if you're into JavaScript (either warming up or as an old-school web developer) you will definitely benefit from the information within this book - and you'll find it light enough to make its reading pleasant!
Good but be aware of some typos...
But beware of the critical typos right in the CODE examples that renders the code in question useless (not function).
For example, in section 4.3.1,
var myObject = {
value: 0;
.....
is wrong. It should be value: 0, (<-- comma after 0 not a semi-colon)
The example as it is written in the book will not run as described.
This will ultimately slow you down if you're a beginner.
I don't care about the typos in other parts of the book but a critical typo in the CODE in a book that teaches CODE is unacceptable.
Overall, the book is worth a reading.
But just be aware of the occasional typos.
This is my first encounter with JavaScript (I am an experienced C, C++, and Objective-C programmer). Crockford's approach, teaching a subset of the language and explaining clearly why you should avoid the rest of it, was exactly what I needed. There's a lot of emphasis on JavaScript's best feature, namely closures or lambda functions, and the explanation of this concept is the clearest that I've read, with plenty of well-made examples. Conversely, I feel the book has saved me a lot of time and frustration by steering me away from the bad features.
Crockford has strong opinions, which may not be to everybody's liking. But this book really does provide the True Clues. Since it is quite brief and compressed, I went looking for a bigger JavaScript book and found Object-Oriented JavaScript: Create scalable, reusable high-quality JavaScript applications and libraries. Its view of JavaScript is fully compatible with Crockford's. Another supplement I recommend is Crockford's video talks at [...]
Your personal guide for JavaScript's most difficult features
Well written and knowledgeable
A must-have for professional-willing JavaScript programmers
Quality that I expect from O'Reilly
I would strongly recommend anyone who intends to write JavaScript code read this book.
In a dense (but always clear) writing style, Crock's work will teach you how to built solid basis for advanced JS applications by using only the very good parts of the language.
If you are going to become a JS Ninja, save your time: don't go with a fat book, read this one (it takes one week) and follow the online API of the framework of your choice (believe me: Prototype and JQuery do not need any additional book) and you'll be on your way with a 1000-shurikens arsenal!
Do proper OO with JavaScript by tapping into its Functional core
However, OO programming can be SIMULATED in JavaScript. There's more than one way to achieve this effect. In this short and illuminating title, Crawford delineates one such way, which relies on some peculiar features JavaScript has in common with functional programming languages, such as "Scheme". (Study the ASP.NET AJAX framework's client side, for a completely different way to go about it. Gallo et al.'s "ASP.NET AJAX in Action" explores this framework brilliantly).
In parallel, this book also serves as a well-reasoned best-practices manual for writing good JavaScript code (a la Crawford...). Crawford's simultaneously a fierce critic, and a starry-eyed lover of the language.
Her smiles, her frowns, her ups, her downs are, clearly, second nature to him, and, like a great tour guide, he'll walk you through the grotesque and the beautiful of this strange, and, oddly, remarkably popular, programming language.
This book is neither an introduction to JavaScript nor a reference thereto. It's certainly not about DOM scripting. The novice JavaScripter would benefit little from it, and, in fact, might find it utterly disheartening, due to Crawford's explicit, harsh criticism. Turn, instead, to the first and third parts of Flanagan's excellent "JavaScript, The Definitive Guide".
In the appendices of this books, you'll find a superbly succinct-yet-exhaustive descrpition of the popular JSON data-interchange format, of which Crawford himself is the designer. A complete listing of a JSON parser written in JavaScript is also available for you to delight in.
"My God. . . It's Full of Scheme"
Unfortunately, he can't do the same for the DOM. We are still stuck with it.
The Good Parts are Pretty Good
Mr. Crockford writes a fine book for anyone who uses or needs to use JavaScript - ever. He quickly presents his view on JavaScript, that it can be a powerful and expressive language, but that it has some rather large warts. The author quickly leads the reader through an introduction to JavaScript, and shows how to avoid the major pitfalls inherent in JavaScript.
This book is fairly terse and not so much a learn-JavaScript book as it is a guide. The beginner embarking on a journey through the JavaScript jungle should certainly purchase this book as a companion to another more beginner-friendly book, to help clarify (and possibly correct) points being taught. I enjoyed JavaScript: The Good Parts, and recommend it to any one who works with or will work with JavaScript. It will make a big difference. Before taking a look at this book, I certainly would have happily criticized this language, but the author makes several good points and made me reassess my opinion of JavaScript. If I am ever in a position where I develop with JavaScript, you can be sure that this guide will be by my side, helping me to avoid the many pitfalls and use JavaScript to its full effectiveness.
JavaScript: The Good Parts
Good book for Programmer to Programmer to learn more about Javascript
I personally think that it is also beneficial to have been exposed to functional programming and object oriented programming (like C# etc.) to get the most out of it.
Worth it for Intermediate JS Programmers
Like JavaScript, the book is more sure of what it is not than of what it really wants to be. Readers should read the preface seriously before going further -- but ignore the contradictory second sentence stating it is for programmers working with JavaScript for the first time. The book will interest language nerds, but it really should be read by intermediate JavaScript programmers who spend too much time debugging code they should never have written.
The short chapters make the book a relatively quick read, despite the somewhat advanced level of the material compared to other JavaScript books. Upon first glance at the size of the book, I was reminded of The Little Schemer (a tutorial on the Scheme programming language). Crockford's writing is easy to read, as if you were collecting thorough notes over a long series of lunch time talks. Incidentally, the structure of the book is unlike "Little Schemer" but Crockford does touch on functional programming techniques.
This book has a strong overtone of frustration with JavaScript. That isn't a criticism of Crockford, but sprinkled throughout the material are the tell-tale signs of what could have been, or should have been, but can never, ever be. It truly gets to a head in Chapter 9, titled "Style", in which 11 paragraphs in three pages start with "I". It is personal for Crockford.
Readers should be aware that there is virtually no error checking in the code. While omitting error checks is a common practice in trade book code samples, Crockford is making a point of illustrating good coding practice. The absence of a disclaimer is odd, but several of Crockford's examples do deal specifically with faulty conditional expressions. Take his warning in the preface to heart again here: "JavaScript: The Good Parts" won't tell you everything you should be doing to write good code.
JavaScript: The Good Parts is not a real reference, but if you do sporadic JavaScript programming it may be a book you will pick up again several times. That's because it is small enough and concise enough to act as a quick reference to the stuff that really is worth using, and some of the parts that really are best avoided.
Best book on JavaScript I have seen
The one thing I had been missing all of these years was a guide to help with this language. What features to embrace, what features to avoid. This book is that guide.
If you are interested in writing better JavaScript, then you should get this book. It will be evaluable to you.
Chapter 1. Good Parts
Section 1.1. Why JavaScript?
Section 1.2. Analyzing JavaScript
Section 1.3. A Simple Testing Ground
Chapter 2. Grammar
Section 2.1. Whitespace
Section 2.2. Names
Section 2.3. Numbers
Section 2.4. Strings
Section 2.5. Statements
Section 2.6. Expressions
Section 2.7. Literals
Section 2.8. Functions
Chapter 3. Objects
Section 3.1. Object Literals
Section 3.2. Retrieval
Section 3.3. Update
Section 3.4. Reference
Section 3.5. Prototype
Section 3.6. Reflection
Section 3.7. Enumeration
Section 3.8. Delete
Section 3.9. Global Abatement
Chapter 4. Functions
Section 4.1. Function Objects
Section 4.2. Function Literal
Section 4.3. Invocation
Section 4.4. Arguments
Section 4.5. Return
Section 4.6. Exceptions
Section 4.7. Augmenting Types
Section 4.8. Recursion
Section 4.9. Scope
Section 4.10. Closure
Section 4.11. Callbacks
Section 4.12. Module
Section 4.13. Cascade
Section 4.14. Curry
Section 4.15. Memorization
Chapter 5. Inheritance
Section 5.1. Pseudoclassical
Section 5.2. Object Specifiers
Section 5.3. Prototypal
Section 5.4. Functional
Section 5.5. Parts
Chapter 6. Arrays
Section 6.1. Array Literals
Section 6.2. Length
Section 6.3. Delete
Section 6.4. Enumeration
Section 6.5. Confusion
Section 6.6. Methods
Section 6.7. Dimensions
Chapter 7. Regular Expressions
Section 7.1. An Example
Section 7.2. Construction
Section 7.3. Elements
Chapter 8. Methods
Chapter 9. Style
Chapter 10. Beautiful Features
Appendix A. Awful Parts
Appendix B. Bad Parts
Appendix C. JSLint
Appendix D. Syntax Diagrams
Appendix E. JSON
If you are new to Javascript I suggest starting with Head First JavaScript (Head First). Once you have read that book, get this book and become someone who thinks in Javascript. At the same time, get JavaScript: The Definitive Guide for the best reference on the language that is in print.
Biased and slightly disappointing
Get it if you have worked in a high-level language before and you care about writing neat JavaScript.
Skip it if you've been writing JavaScript and you want a comprehensive non-biased reminder or reference book.
Answering the WHYs in JavaScript
This book encapsulates a lot of that. A lot of great advice is packed in this short and sweet book. It is also a pleasure to read to boot.
This is not a JavaScript reference book, but instead it is an honest overview of the language features, including the bad stuff that we need to stay clear off.
I'd recommend this book to anyone that thinks JavaScript is just another curly-brace based language.
Required reading for JavaScript developers
Oh, and don't be thrown by other reviewers' complaints that the book is too short. It's just the right size for what it's trying to teach.
Create your own review



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