JavaScript: The Good Parts



Price: $19.79Usually ships in 24 hours


JavaScript: The Good Parts (O'Reilly Media, Inc.) - December 2008Publisher: O'Reilly Media, Inc. - December 01, 2008

ISBN-10: 0596517742, ISBN-13: 9780596517748

Author: Douglas Crockford


153 pages

One of the top-selling books


JavaScript: The Good Parts





Customer Reviews

Terse Just to Show He Can

Barely helpful. Yes, he identifies the "good parts", but that's it; he doesn't finish the job with explanation. People who fashion themselves as elite programmers will give this book a good review. He repeats himself with cut and pasted text. There are lots of "railroad" diagrams of grammar like some bad Oracle documentation on SQL.

He's pretty impressed with how terse he can be. For example, he doesn't use the ++ operator because he says it's "too tight, too tricky, too cryptic". But then he uses sentences like the following to show just how terse and impressively obscure he can be: "The first thing in a statement cannot be a function expression because the official grammar assumes that a statement that starts with the word function is a function statement." This is followed by nothing.

Oooh...snap...you're so tight. The guy is a JavaScript wizard, but he can't explain or show how to use "the good parts".

Keith A. Overstreet
06 October, 2010


Don't code against the grain, stick to the good parts.

According to the author, one of the biggest problems with JavaScript is that most people don't bother to learn the language before they start using it. Indeed, I was one of those people. My first impression of JavaScript was that it was flaky and fragile and very difficult to write robust production quality code in. It wasn't until I came back to JavaScript this year and read this book that I realized that most of my impressions were wrong and that if I coded with the grain, JavaScript is actually quite good and very powerful. This author does an excellent job of pointing out that though JavaScript shares its syntax with Java, C++ and C#, its actually a lot closer to lisp or scheme in the way you should go about programming with it. He carefully discusses what parts of the language to use liberally and what parts to avoid. As a professional developer with many years experience with C++ and C#, I found this book really helped me finally grok this language. Be thankful when you see how thin this book is. Each page is loaded with details and so it will take more work than you expect to wrap your head around all the great information.

Sean Kelly
04 October, 2010


Excellent, Succinct Resource

Doug is great at presenting complex Javascript concepts using few words. I recommend his work!

Shannon Norrell
04 October, 2010


A Great Book on how to write Javascript

Javascript is so easy to misuse - specially for people like me that have a Java background. This book has a bit of "what can you do with Javascript" but it is the "how should you go about using javascript" parts that really help when starting to write bigger Javascript applications. The book isn't that long, but somehow it covers many important topics for its length.

Pirkka Jokela
25 September, 2010


Fantastic Book

I learned a lot from this book. This is not just about syntax but a lot of experienced tips!

Y. Ge
24 September, 2010


Great Javascript Book. Not for n00bs though.

Great book.

The material is relevant and concise. Perfect guide for someone who has programmed in other languages but wants to get into Javascript.


Not for n00bs though. N00bs, you've been warned.

RYAN M LABOUVE
01 September, 2010


Great Javascript Book. Not for n00bs though.

Great book.

The material is relevant and concise. Perfect guide for someone who has programmed in other languages but wants to get into Javascript.


Not for n00bs though. N00bs, you've been warned.

RYAN M LABOUVE
01 September, 2010


One of the best JavaScript small references book

JavaScript: The Good Parts by Crockford is written to be a quick and small reference for the javascript programmer.

It is not an exhaustive reference but rather a small collection of guidelines on how javascript code should be written.
The book touches on the major aspects of the language: objects, functions, prototypes, inheritance (with all its flavours), arrays and regular expressions.

Maybe the most important part of the language is given the most pages: functions. The chapter on functions gives a good understanding on function invocation patterns, on closures, callbacks, scope, augmentation, memoization, currying and function arguments.
Another important chapter is on inheritance and explains different inheritance styles. Although nice to read in general, the book also has some boring parts, like chapter 2 where javascript grammar is represented in many diagrams, one for each language construct.

There are some nice appendix chapters on the awful and the bad parts of javascript, which warn the reader of the possible pitfalls of using these parts of the language.

Alltogether, it's a must-have book for every javascript programmer, not necesarrily to take up all ideas but at least to understand the point Douglas Crockford has and only adopt the agreed practices.


Ionel Condor
01 September, 2010


Not a simple reading sometimes, but direct to the problem

You can be sidetracked from the tiny size of this book, but is not a simple reading. This is not for people that wanna learn Javascript from scratch, but for programmer who already knows Javascript features and wanna go over it.

Even a long-experienced Javascript user will learn something new for sure from this great reading. I think that ALL must read this at least one time.

I can find only two drawbacks:
1) Some arguments are only named, but not really deepened
2) The only real critic to what is teach is about a "new way", less error-prone, to create objects in Javascript. The author really explain it and what is the problems with the standard method (about using or not the "new" operator)... but even if his arguments are good, the way he advise is not standard, and for me this is bad.

Luca
29 July, 2010


Crockford's book will improve the web

I have tried to learn strong Javascript skills many, many times over more than a decade. My shelves are full of thick 'Bibles' on the topic. The problem has been, amidst all the terrible features of the language (and let's be honest, it has way more than it's fair share), I never had the patience, perseverance or time to break through to the gold. This book is brilliant. From the first chapter, Crockford is speaking my language.

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.

Damien Sawyer
24 July, 2010


Your personal guide for JavaScript's most difficult features

I found this book excellent in its descriptions of functions, methods, arrays, inheritance, and several other more abstract features of JavaScript. This book will not teach you JavaScript but it will improve what you already know. It's a moderately easy read and also very easy to look up a specific feature you want to know more about.

psulover901
19 July, 2010


Well written and knowledgeable

This is a good book so far. The author takes the view that Javascript is not really a great language, but we're stuck with it, which is how I feel. It's not really a good book for learning Javascript if you've never seen it before. He uses functional diagrams for the syntax definitions of all the constructs, which, while being a good concise, complete definition, are less easy to read and understand than a few examples. But the book is basically supposed to be a pitfalls, tips & tricks, sort of thing, and for that I'd say it's good. He writes clearly, and seems very knowledgeable about the language and language theory in general. He's a little full of himself, but most programmers are.

N. Hannum
12 July, 2010


It is the The Good Parts of JavaScript

Not for JavaScript entry level programers.
But if you know your JavaScript and you want to take it to the next level, this is a book fro you.

Raanan Avidor
04 July, 2010


Great for a programmer who needs to learn Javascript

The project I was just moved on to is a web based application we'll be building from the ground up. Many of us on the team don't have any Javascript experience, we all came from a Java background. I haven't read the whole book yet, but what I have read has been quite helpful at lowering the learning curve and starting to learn at least some type of best practices. If you come from a Java background and are familiar with Effective Java, I think this is about as close as you'll get to that for Javascript.

chumpus
26 June, 2010


Appallingly bad book

A slim book that does little to encourage good JavaScript coding practices. OK, the JavaScript language is flawed as the title of the book implies, but the author defends one of its most flawed aspects - loose typing - in the very first chapter. Note that I call it loose typing, as calling it dynamic typing would be doing a disservice to languages that have a better dynamic type system. The author encourages the reader to not use unary ++ and -- operators, because he claims it's been the cause of bugs in C code. This is bizarre - does "i += 1" rather than "++i" really avoid potential problems in C, and of what relevance is that to JavaScript even if it did? Crockford talks about functional programming a lot, but a lack of support for immutability and scoping makes this an unlikely paradigm that would be of any benefit to JavaScript coding. The code examples are poorly written (nesting statements up to nine levels deep in several places) with little, or more often, no commentary. This lack of commentary would be acceptable if the code was clear, but is more often obscure and hackish.

In summary, I'd give this book no stars if possible, and suggest looking elsewhere a decent book on JavaScript.

C. Wareham
28 May, 2010


Seminal book on JavaScript

It is no wonder this book gets some mixed reviews. In it lies the distilled knowledge of possibly more than a decade of improving JavaScript by someone who know it inside out. It reminds me of K&R: a very compact, seminal book that presents the philosophy of the language, or should I say the revised philosophy behind the good parts in this case, reasoning its conclusions and presenting best practices for the outstanding new features (all right, closures and prototypal inheritance are not new, but they were dormant in excellent but out of fashion languages). It is also no small feat to have a correlation between programming language theory (what languages should 'do'), different programming paradigms (functional programming, inheritance, loose typing) and how much of it can be achieved in JavaScript. If you -like me- despised the snippets of code embedded in annoying web pages of yore, maybe you will also appreciate the fortunate mixture of Self, C and Scheme that lies inside the /good parts of the/ JavaScript language. To summarize: if you are looking for classical web programming, HTML templating, 'cookbook'-style piles of mind-numbing recipes, look elsewhere. Also, forget the stupid compromises and bad design that went into JavaScript. This work I regard as a gift to the community to highlight features no other mainstream language offers.

Lucia M. Rotger
15 April, 2010


Good book for Programmer to Programmer to learn more about Javascript

This book definitely feels like a programmer to programmer book to learn about Javascript (and what are its good parts and why). It is very concise which is nice, but because of this if you are new to programming you might get frustrated.

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.

Aseiu P.
06 April, 2010


A good book on JavaScript

A very good introduction to JavaScript. It only deals with the language itself, and doesn't worry about DOM scripting or implementation details and inconsistencies in different browsers; you'll need a different book for that.

Alexey Romanov
01 March, 2010


Worth it for Intermediate JS Programmers

The reader of "JavaScript: The Good Parts" by Douglas Crockford will get a very good idea of why JavaScript is considered a runt among programming languages. Crockford does his best to model good programming patterns and style in JavaScript. It is unfortunate and telling that the book is so thin. Crockford neither pulls his jabs at the language nor dumps on it unfairly, but gives a clear rationale for his opinions.

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.


Mitchell C. Amiano
10 February, 2010


Required reading for JavaScript developers

This is the first book anyone touching JavaScript must read. Learning JavaScript from any other source (book or website) will teach you bad habits that will be difficult to break. Just pretend that JavaScript is the "good" subset that's taught in this book and look up the bad parts as you encounter them in other people's code. Now I've got 1500 lines of JavaScript I have to go back and fix because I didn't read this book two months ago.

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.

Lawrence Kesteloot
11 January, 2010


The True Clues om JavaScript

I was reading Coders at Work and came to the chapter on Doug Crockford. I was impressed enough to put the book down and order this one. As soon as it arrived I read it from cover to cover (it's short).

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 [...]

David Casseres
09 January, 2010


Unique Approach

I love this book. Mr. Crockford covers a ton of very usable information in a relatively small volume. If you are the kind of developer who likes to be spoon-fed popular programming idioms, you might want to look elsewhere. If you want to master the nuts and bolts of JavaScript, this elegantly condensed and filtered version of the ECMAScript specification is probably for you. I would welcome a similar treatment of Python and Ruby. The author's no BS approach is refreshing.

Dragon_71
13 November, 2009


A few gems, but too much filler

This book has some good parts, even some great parts. Many parts of Chapters 3, 4, and 5 are very insightful, and might revolutionize how you think about Javascript, even programming in general. (Unless you come from a Lisp or functional programming background, in which case the insights will be old hat to you).

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.


J. Croisant
08 November, 2009


High hopes, Sad reality

Abstracted from the Preface:

"intended for programmers who, by happenstance or curiosity, are venturing into JavaScript for the first time" 1

"This is not a book for beginners" 2

And this is just the first page of the preface. While preparing comments on this book, I reread the preface no fewer than five times in a vain attempt to divine the meaning behind these conflicting statements.
I emphasize the term "reread" since in crops up real soon:

"it takes multiple readings to get it" 3

The first page of the preface provides the key to understanding this book. The book is far too short on explanations and context. You're forced to read and reread important material to extract any return from your investment. And rereading the material is no guarantee that you get useful insight. So much is assumed that you better have the Rhino book handy.

The sad reality is that with thoughtful treatment, this book could be a blockbuster for advanced JavaScript programmers tasked with building the next jQuery or similar library. Since most programmers are library consumers, this also implies that only a small subset of programmers might benefit from a complete discussion of the advanced subject matter only hinted at in this book. As an aside, It would make the library consumers of the world, well.. better library consumers and there is value in that as well.

1. From the preface, page xi, first paragraph, first sentence.
2. From the preface, page xi, third paragraph, first sentence.
3. From the preface, page xi, fourth paragraph, fourth sentence.





Rex Pebble the II
01 November, 2009


Material is good, but author attitude is not

I'm new to javascript and wanted a book just to get me started. I figured this book was as good of a starting point as any.

The material is good, but not always explained very well.

I gave the book only 3 stars because I found the author's blatant bitterness and self-righteousness to be distracting.

S. Carr
27 October, 2009


Repetitive, opinionated, and cranky

Short but repetitious. A bad combination. Majorly disappointed by this one.

First of all, it's not really a JavaScript book - much of the advice offered is very generic. Like YOU MUST USE PARENTHESES AROUND CONDITIONAL BODIES. Repeated three times. And the evils of ++ and -- operators. The author forbids these even in for loops. Huh?

I don't care about the code for solving the Towers of Hanoi. I want to learn more about JavaScript! Unfortunately the descriptions of prototypes, functions, inheritance, in here are so terse that I have to spend far longer than is necessary in rereading them.

The "railway" diagrams are pure filler. Page after page. Come on, NOBODY reads these.

And what have regexps got to do with JavaScript per se? Nothing... so why do we need a whole chapter on them?

For that matter, why does Yahoo! NEED a "Chief JavaScript Architect"? Bet Google doesn't have one.

JavaScript only survived the first year of its life because Applets were so obviously useless. It only survived its childhood because teenage hackers liked its lack of a type system and its simple way of doing simple things (badly); and it is only alive today because AJAX came along. I wanted this book to change my mind about how awful the language is. It didn't. Instead I got the semi-random ramblings of someone who's invented some fairly trivial tool - JSLint - and thinks it solves everyone's problems. Well, it doesn't. My IDE does a better job these days.

BillyJoeBob
12 October, 2009


Sound advice on coding to Javascript's strengths rather than fighting them

This book is another in the series of books lately reclaiming Javascript as a powerful language that hasn't gotten it's due (see Stefanov's book for another good example). Crockford makes a great case for Javascript not needing to please the crowd of class based languages and instead using it's prototype functional roots to their max to achieve similar ends (code reuse, inheritance, private data..). His examples showing how to do class styled coding in javascript (though using prototypes in the inside, as that what the language has to offer) followed by a more pure object to object prototyping really sends the point across in comparing elegance and benefits of the latter over the former within Javascript's rules.

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.

Y. Maman
07 October, 2009


Short and to the point!

No messing with the DOM in this book! Here you learn the core syntax of Javascript in an easy to read way, while staying away from the pitfalls of the language.

I read it in a matter of two days, and I really feel more confident about my Javascript with this knowledge under my belt.

Combine this with one of the books on jQuery and you could be a rockstar in no time at all!

Consider one (or several) of these books:
Learning jQuery 1.3
jQuery in Action
jQuery UI 1.6: The User Interface Library for jQuery


Robin Smidsrød
22 July, 2009


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 that really can help you take your Javascript programming to another level.

Chris van Hasselt
02 July, 2009


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!

C. Dumont
30 June, 2009


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 Designs (3rd Edition) (Addison-Wesley Professional Computing Series). You're still going to need to get JavaScript: The Definitive Guide to learn how to use JavaScript in your web pages, but this book will deepen your understanding of JavaScript and show you how to write cleaner code.

I thoroughly enjoyed reading it.

Bradford C. Smith
16 June, 2009


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 book. After this read, I did realize one thing for sure: JavaScript is a pretty lame language and needs to go away.

M. Tomich
21 May, 2009


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 closure and understanding of the quirks and tricks of the language. Do not let the size of the book deceive you as Douglas Crockford manages to pack a lot of hard-earned wisdom into very few pages. In fact, this is not a book for beginners.

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.

Ilya Grigorik
19 May, 2009


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. It does an excellent job of demonstrating to the developer how to get away from the object oriented class model that most popular languages of today utilize, and use the class free prototypal inheritance model which JavaScript was designed for.

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.


Nicholas Salvadore
13 May, 2009


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 programming languages would sustain me while I learned JS from one of the masters.

I found the book to be terribly frustrating. I got as far as Chapter 5, Inheritance, before I gave up on it. The book was too full of jargon, and even though it was written for experienced programmers just getting started in JS (like me), it seemed to assume a set of prior knowledge that I didn't have.

The author obviously knows his stuff. The language flows well and is logically organized. The syntax diagrams are clear and easy to follow if you're an experienced programmer. The book is well organized, and well edited. O'Reilly did their usual excellent job with it. It's simply not a good resource for learning JS from scratch.

I will return to this book after I learn JS from some other source. It may make more sense the second time around.

Ray Depew
13 April, 2009


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.

C. Shurtliff
17 March, 2009


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.

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.

Christopher Brandsma
17 March, 2009


Small, but dense

When it comes to JavaScript, Douglas Crockford is "The Man". When it comes to browsers, JavaScript is "The Language". "JavaScript: The Good Parts" should be read - and comprehended - by every web developer, regardless of their programming proficiency.

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.

Badotz
02 March, 2009


Good for the beginner only

I just read through this book in about 15 minutes. It is a very short book. The parts that were interesting needed more examples or explanation. This would have been a good presentation for stage .. the kind where you go "Hmm that's interesting, I'll read a book about that to learn more about it." Except, this IS the book and and it drops off just when it's getting good.
For beginners it is important to know about the concepts in this book. If you've done any programming with JSON you probably know most of it already. The rest you could figure out via google.

Robert R. Becker
28 February, 2009


A must-have for professional-willing JavaScript programmers

Absolutely necessary for anyone who wants to understand the very core of the language and its advanced features; Tremendously useful for anyone who wants to start thinking about JS from a OOP view, understanding the alternative paths the language has taken rather than classical inheritance and other traditional concepts.

Diogo B. P. Pinto
10 February, 2009


Crock Attack!

In a JavaScript world that starts imitating the J2EE of past years (with the rising of several frameworks that do the same thing) this book stands out like a lifesaver.
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!

Costa Michele
27 January, 2009


Using the good parts will increase quality and save a lot of time and grief

I read JavaScript: The Good Parts by Douglas Crockford and learned a lot from it.
I feel that he makes very good points on his commentaries on the awful and bad parts of JavaScript and his suggestions to use a "good parts" subset of the language does seem to hold ground and increase quality and development time. At least, that is the case on the project that I'm working on that involves JavaScript. I seem to have fallen to just about all the pitfalls that he points out. Reading his book was a great comfort (I'm not the only one thinking that this or that aspect of the language stinks and for a good reason...) to me and his work-around suggestions do seem to be useful and practical. Along with other two very useful books on JavaScript: Bulletproof Ajax by Jeremy Keith (I have reviewed this book too on Amazon) and AJAX Security by Billy Hoffman and Bryan Sullyvan (see my Amazon review for this book too) I think that any developer that usews JavaScript can get a clear picture on the good sides and bad sides of JavaScript and clear understanding of the "do"s and the "don't"s and the implication of doing things one way or the other.

There are some mild typos in the book, that I'm sure will be corrected in future editions (e.g., pp.60: "... 'shi' has its key changed from '4' to '3'..." should be "... 'shi' has its key changed from '3' to '3'...", I believe).

Considering the fact that the author states several times that the book will avoid the bad parts and concentrate on the good parts, it is quite stressed in the book when bad parts are discussed, and some bad parts are repeatedly being mentioned and the implications of using them along with their proposed work around is also re-iterated (e.g., arguments list which is not really an Array object, or the fact that null is being identified as an object, and there are many more examples).

I liked a lot the "functional" approach, which I enjoy and like to use in many of my Perl scripts and programs, and I also use a lot in my JavaScript scripts and programs. I do find the "functional" way of doing things to be lighter and more straightforward than the classical object oriented approach that many advocate (which I don't really find very useful most of the time). For those that want a non lisp/scheme/haskell introduction to functional programming see a very nice Perl book that introduces functional programming: Higher Order Perl by Mark Jason Dominus (see my Amazon review on the book).

I really really enjoyed reading the book. I found the advise there very useful and I learnd quite a lot of things about JavaScript.

Shlomo Yona
15 January, 2009


Do proper OO with JavaScript by tapping into its Functional core

Java is an Object-Oriented language; JavaScript ain't. JavaScript provides no integrated support of type-inheritance, encapsulation or polymorphism - the cornerstones of the Object Oriented paradigm.

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.

Itai
09 January, 2009


50 good pages

Not worth the price. The good part of "The Good Parts" was only about 50 pages.

Richard Robertson
06 January, 2009


A good book on an inadequate topic

This is a short, well-written book that covers its topic, JavaScript, beautifully. Sadly, JavaScript is not a topic worthy of its own book.

With such limited built-in libraries and a major browser maker hostile to improving them, JavaScript exists only as a tool for manipulating web browsers. The challenges faced by JS programmers do not include language issues such as dynamic scoping or functions-as-objects, but the nonsensical, incompatible, browser document object models (DOMs).

As a book about the good parts of JavaScript, the DOM is not covered. Sadly, its not the good parts we need a book on.

David Crawshaw
19 December, 2008


Brilliant book

If you already know that you need to escape a for each with hasOwnProperties, this book is not for you.

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.

James G. Driscoll
09 December, 2008


Underwhelming

There just isn't enough unique content in this book for it to stand alone and be sold at the book's cover price. To be fair, there's some good content in the book (some), but just not enough to be worthwhile. This entire book could've been a series of blog entries, or perhaps a section in an updated edition of the Rhino book.

I wouldn't recommend buying this book. However, if you're intent on getting a copy, look for used copies or copies at bargain prices (less than $10).

Harold Osmundson
02 December, 2008


A good book


It is easy to write bad code in javascript. This book helps you to avoid potential pitfalls and write clean and structured code.

B. Jeevanantham
24 November, 2008


Not much there

I was very disapppointed in this book. For the price of the book there was very little content. I am returning this book and buying something with more substance.

George Clay
05 November, 2008


Second best book on JavaScript

This is an excellent book, as it concisely illustrates a number of details that would be impossible to find in other books. Moderate/advanced JavaScript programmers will gain the most from this book, it is not particularly geared towards the beginner.

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.

E. Welker
26 October, 2008