Enjoy fast, free delivery, exclusive deals, and award-winning movies & TV shows with Prime
Try Prime
and start saving today with fast, free delivery
Amazon Prime includes:
Fast, FREE Delivery is available to Prime members. To join, select "Try Amazon Prime and start saving today with Fast, FREE Delivery" below the Add to Cart button.
Amazon Prime members enjoy:- Cardmembers earn 5% Back at Amazon.com with a Prime Credit Card.
- Unlimited Free Two-Day Delivery
- Instant streaming of thousands of movies and TV episodes with Prime Video
- A Kindle book to borrow for free each month - with no due dates
- Listen to over 2 million songs and hundreds of playlists
- Unlimited photo storage with anywhere access
Important: Your credit card will NOT be charged when you start your free trial or if you cancel during the trial period. If you're happy with Amazon Prime, do nothing. At the end of the free trial, your membership will automatically upgrade to a monthly membership.
Buy new:
$15.20$15.20
FREE delivery: Dec 19 - 21 on orders over $35.00 shipped by Amazon.
Ships from: Amazon.com Sold by: Amazon.com
Buy used: $9.61
Other Sellers on Amazon
FREE Shipping
100% positive over last 12 months
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Follow the author
OK
JavaScript: The Good Parts: The Good Parts First Edition
Purchase options and add-ons
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.
- ISBN-100596517742
- ISBN-13978-0596517748
- EditionFirst Edition
- PublisherO'Reilly Media
- Publication date
2008
May 1
- Language
EN
English
- Dimensions
7.0 x 0.4 x 9.2
inches
- Length
176
Pages
Frequently bought together

Similar items that may ship from close to you
From the brand
-
-
Sharing the knowledge of experts
O'Reilly's mission is to change the world by sharing the knowledge of innovators. For over 40 years, we've inspired companies and individuals to do new things (and do them better) by providing the skills and understanding that are necessary for success.
Our customers are hungry to build the innovations that propel the world forward. And we help them do just that.
From the Publisher
From the Preface
This is a book about the JavaScript programming language. It is intended for programmers who, by happenstance or curiosity, are venturing into JavaScript for the first time. It is also intended for programmers who have been working with JavaScript at a novice level and are now ready for a more sophisticated relationship with the language. JavaScript is a surprisingly powerful language. Its presents some challenges, but being a small language, it is easily mastered.
My goal here is to help you to learn to think in JavaScript. I will show you the components of the language and start you on the process of discovering the ways those components can be put together. This is not a reference book. It is not exhaustive about the language and its quirks. It doesn't contain everything you'll ever need to know. That stuff you can easily find online. Instead, this book just contains the things that are really important.
This is not a book for beginners. Someday I hope to write a JavaScript: The First Parts book, but this is not that book. This is not a book about Ajax or web programming. The focus is exclusively on JavaScript, which is just one of the languages the web developer must master.
Editorial Reviews
About the Author
Douglas Crockford is a Senior JavaScript Architect at Yahoo!, well known for introducing and maintaining the JSON (JavaScript Object Notation) format. He's a regular speaker at conferences on advanced JavaScript topics, and serves on the ECMAScript committee.
Product details
- Publisher : O'Reilly Media; First Edition (May 1, 2008)
- Language : English
- Paperback : 176 pages
- ISBN-10 : 0596517742
- ISBN-13 : 978-0596517748
- Item Weight : 10.2 ounces
- Dimensions : 7 x 0.38 x 9.19 inches
- Best Sellers Rank: #427,652 in Books (See Top 100 in Books)
- #81 in JavaScript Programming (Books)
- #436 in Software Development (Books)
- #548 in Internet & Telecommunications
- Customer Reviews:
Important information
To report an issue with this product, click here.
About the author

Douglas Crockford is the author of How JavaScript Works. He has been called a JavaScript Guru, but he is more of a Mahatma. He was born in Frostbite Falls, Minnesota, but left when he was only six months old because it was just too damn cold. He has worked in learning systems, small business systems, office automation, games, interactive music, multimedia, location-based entertainment, social systems, and programming languages. He is the inventor of Tilton, the ugliest programming language that was not specifically designed to be an ugly programming language. He is best known for having discovered that there are good parts in JavaScript. That was the first important discovery of the Twenty First Century. He also discovered the JSON Data Interchange Format, the world’s most loved data format.
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonReviews with images
Submit a report
- Harassment, profanity
- Spam, advertisement, promotions
- Given in exchange for cash, discounts
Sorry, there was an error
Please try again later.-
Top reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
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
I do not understand the majority of complaints. Some compare Crockford to "the most boring professor you ever had", others said the information was poorly organized and not written very well. Others complained about his ego getting in the way. I, for one, found it to be very interesting and useful. Parts of it were a struggle to get through (and I've been a C coder for 20+ years) but mental challenges are a software engineer's specialty.
In my opinion, none of the complaints are completely true, assuming you are the right audience. This book is NOT for beginners. If you are relatively new to Javascript, it will definitely be useful, but if you are new to programming entirely, this book is not for you. This is a more academic book that gives you a peek behind the scenes to the inner workings of the Javascript language. It is more comparable to K&R's book for C Programmers, but not as complete (just the "good" and "awful" parts!).
It is a book about the Javascript LANGUAGE. It is NOT a book on web programming. It will NOT teach you anything about HTML, or the DOM, or how to put little fiddlly-bits on the screen, or how to work out game physics, or how to use any HTML-specific components. It is a book on the constructs of Javascript, plain and simple. It should NEVER be the only book on Javascript you would own, but if you are serious about Javascript, it should definitely be in your library. I don't think you can be a Javascript master without this book.
My minor grievances are mostly limited to subjective areas where I disagree with him:
1) He states his opinion absolutely, more so in the first part of the book. I prefer a less forceful approach that presents the arguments and lets you decide for yourself. However, I do not feel he went overboard in this regard as some did - I suspect they didn't get very far into the book.
2) While I completely understand the Javascript bugaboo that makes a case for mis-aligned curly braces (K&R style). I cannot get myself to follow this convention (except in a few areas where I make exceptions) To me, code is SO much easier to follow when all blocks are aligned. I will heed his advice and avoid the lurking JS bug, but I will not fully convert to misaligned braces. I resent that his JSLint tool generates hundreds of errors in my code because of this - but fortunately, there's an option to turn it off.
3) When he digs into some of the JS-specific patterns that aren't familiar to non-JS programmers, I wish he would add a disclaimer along the lines of "while this is a powerful tool, understand that depending on such patterns may make the code more difficult to maintain by others less trained in the specifics of Javascript. Or at least comment vigorously." I am a firm believer in "clarity over cleverness" in shared code.
4) In some of the trickier subjects, a few more examples would makes things easier to comprehend. I've never really used Regular Expressions before, and the chapter left my head swimming, and I felt the explanation of the various components of the expressions could have been better.
But these are not major grievances, and I whole-heartily recommend this book for the intermediate Javascript user or the novice JS user who has a solid background in general programming language constructs.
Top reviews from other countries
Je pense que n'importe qui développant pour le web a eu son lot de surprises désagréables avec Javascript. Et, en comparant avec d'autres langages, je crois bien ne pas être le seul à me dire que Javascript a quand même plus que sa part de problèmes.
Donc voilà un livre qui offre une perspective intéressante. Mais je crois bien qu'elle est indispensable. En effet Javascript était synonyme de dynamiser ses pages Web. C'est moins le cas aujourd'hui mais ça reste son utilité principale. Et cela teinte fortement notre pratique du langage : finalement, on cherche surtout des solutions spécifiques. Etant donné les disparités entre navigateurs, on se tourne un jour ou l'autre vers les frameworks Javascript (généralement très tôt). Pour assainir encore plus le code, j'utilise pour ma part JSLint, outil créé par l'auteur de ce livre d'ailleurs. Car les frameworks restent des frameworks et ne peuvent changer (généralement) le langage sur lequel ils se basent. L'ingrédient restant, c'est la pratique, pour développer une certaine autonomie et une méthodologie efficace.
Il n'empêche que tout cela, c'est tourner autour du pot. Même avec les bonnes références du langage disponibles sur Internet, je n'ai pas passé le cap de la maîtrise du langage, celui où vous n'allez vérifier la documentation et les forums que pour un détail qui vous a échappé ou une situation inédite. Et bien voilà ce que m'a permis le livre de Mr Crockford, passer enfin ce cap.
Si on part du chapitre 3 -Objects- jusqu'aux appendices A et B (Awful Parts et Bad Parts), vous avez un condensé de moins de 100 pages sur ce que l'auteur juge être l'excellence en Javascript. Forcément c'est subjectif. Mais c'est sacrément pertinent et plutôt complet et, pour 100 pages seulement, le jeu en vaut la chandelle. Franchement, la première chose que j'ai fait -parce que je n'étais pas convaincu à 100% par le sujet- ça a été de lire les appendices A et B: 14 'awful parts' et 12 'bad parts'. Et bien, même si on n'est pas d'accord avec la catégorisation subjective de l'auteur, on réalise combien de plâtres il faudrait essuyer avant de se fixer sur une base stable!
Douglas Crockford a fait ce travail et il l'a bien documenté avec ce livre. Ce serait très dommage de s'en priver. D'autant plus que Javascript est manifestement un de ces rares langages qui risque de rester pour un bout de temps.
Perhaps more importantly, Crockford is very, very aware of how JavaScript differs from classical OO languages, and how these differences can and do trip up classically trained programmers, coming from (say) C++, C# or Java backgrounds. Crockford goes out of his way to point out the differences and the new way of thinking that is required for JavaScript.
This book is not necessarily going to be an easy read, even for professionals. Crockford says so himself in the preface. It's dense and terse. By necessity it introduces terms that might be confusing at first, and which are only explained later. You have to read the whole book, patiently waiting for certain concepts to be explained, and for things to fall into place. On a re-read it all begins to make real sense. I do recommend that this book is read at least twice, preferrably three times. At least it's short!
There is not much to do with the web in this book. There's no DOM manipulation examples, and no Ajax calls. You will find no discussion of modern JavaScript libraries. Crockford just focusses on his area of expertise: the JavaScript language. He highlights and promotes the good parts, and in appendices talks about the "Awful" and merely "Bad" parts.
This is an important book. Crockford writes with the authority, seriousness and simplicity of K&R. To be a modern web developer you really need to know what you're doing with respect to JavaScript. Look to other books to discuss JavaScript libraries, the DOM, animation effects and Ajax. Look to this book for the starting point to all that: the JavaScript language itself, weird and wonderful, familiar yet strange, bad parts and (fortunately) good parts.
The quicky - this is a must have book for anyone who even just write one line of javascript.
Now here is the reason - I have been programming with javascript for 10+ years. Recently I went for an interview with an international company that head quarter in Tokyo, start with a S ;) They gave me a test - on a piece of paper. Hate to say this, but people like me really not build for reading code on a piece of paper. But there really is no excuse that I fail quite a few questions here and there. And I memorise them all to find the answers. It turns out that they are all very basic javascript quirky stuff.
Hence I bought this book as a refresher to remind me - if I really want to be true professional Javascript coder. I MUST go back to the basic and re-learn all the good bit and throw away the bad bits. Like the evil of Global var. What really is closure. And the whole mess of prototype. And if you are like me who do more than 5 different programming languages. It could be really hard to get away with the classical class system and get into the everything is object but not quite a class state of mind.
Like the book mentioned - Javascript is an amazing invention and hugely expressive language. There must be a reason why Java applet fail but Javascript is getting bigger and bigger each day.
Conclusion, after reading this book - I am more confident than ever that my coding style is pretty good :) plus I am arming with better fundamental knowledge to tell the other - why they are wrong.
Afin de bien comprendre le but du livre, il est nécessaire de savoir qui est ce Douglas “Papa” Crockford et pourquoi Javascript a des mauvais côtés. Sir D. Crockford est considéré comme l’un des pères de Javascript par la communauté éponyme. Il est le créateur du fameux format JSON et de l’outil JSLint.
Douglas Crockford est un homme qui aime la rigueur, la qualité du code et qui le veut simple de lecture aussi bien par l’homme que par la machine. Il nous apprend donc dans ce livre à apprécier les bonnes fonctionnalités et à oublier les maléfiques ! Il le fait par des exemples concrets et explique clairement sa démarche par l’apprentissage. Bien sûr, certains points sont à la bonne appréciation du lecteur, mais l’auteur nous explique pourquoi telle ou telle fonctionnalité est à écarter. Libre à nous, ensuite, de la garder ou non.
Ce livre m’a donc littéralement ouvert les yeux sur certaines pratiques que je pensais bonnes, mais qui sont, quand on creuse, mauvaises ou susceptibles de faire tomber notre code à la moindre secousse.
A la fin de ce livre, vous serez donc avertis de ce qu’il faut faire en Javascript pour éviter les pièges classiques qui font malheureusement partie du langage de par son historique. Si vous avez l’ambition de parfaire vos connaissances en Javascript, vous devez lire ce livre !
Il existe une version Version Française, JavaScript : Gardez le meilleur ! , traduit par Patrick Fabre. Cependant, je pense qu’il est préférable de le lire en Version Originale si vous êtes à l’aise avec l’anglais. Car dans la traduction, ce qui ne devrait pas être traduit, selon moi, l’est. Par exemple, la closure devient la fermeture. Pourquoi apprendre de nouveaux termes techniques que nous ne reverrons nulle part ailleurs ?
Lire plus de détails : [...])








