Automotive Holiday Deals Books Gift Guide Books Gift Guide Shop Men's Athletic Shoes Learn more nav_sap_plcc_6M_fly_beacon Adele egg_2015 All-New Amazon Fire TV Grooming Deals Gifts Under $50 Amazon Gift Card Offer bf15 bf15 bf15 $30 Off Amazon Echo Starting at $49.99 Kindle Black Friday Deals Outdoor Deals on DOTD

Customer Reviews

4.7 out of 5 stars94
Format: PaperbackChange
Price:$17.85+ Free shipping with Amazon Prime
Your rating(Clear)Rate this item

There was a problem filtering reviews right now. Please try again later.

99 of 101 people found the following review helpful
on October 14, 2010
It's often difficult to find good intermediate to advanced technical books that help you get over the hump. This is most definitely one of those books, IMO, along with Javascript: The Good Parts by Crockford and High Performance JavaScript by Zakas.

If you're a beginner, even an ambitious beginner, such as an experienced programmer in another language, you don't want to start here. For beginners, I'd recommend Zakas (Javascript for Web Developers) as the most complete introduction to Javascript, the DOM and browser scripting; or Simply JavaScript from Sitepoint for a gentler introduction that emphasizes the separation of structured content (HTML), presentation (CSS) and behavior (scripting the DOM with Javascript).

OTOH, if you're more or less comfortable with core Javascript and the DOM but want to clarify and explore the many idiosyncracies and fine points of JS, this book really hits the sweet spot. The table of contents is available on Amazon or O'Reilly, so I won't recap it - but will mention that Stefanov both chooses his topics and covers and organizes his material very well. This is a precisely and well-written book, and the reader will infer that there must have be a lot of experience, previous history and discussions behind these 200+ pages. I've read the blogs of the majority of his technical reviewers and believe you're in good hands here. I'm really lovin' this book. The only caveat - don't expect a lot on browser scripting. However, I'd be surprised if the somewhat experienced, but non-ninja, Javascript programmer did not significantly take his/her knowledge to a higher level after reading JavaScript Patterns.

* * *

Addendum: I was interrupted by a rush job during my initial reading of this book and after returning to it now and rereading the early chapters and carefully reading several of the later chapters, I'm even more impressed by this book. The heart of the book, when it gets a little more advanced (functions, object creation patterns and code re-use patterns) has proved really valuable.
0CommentWas this review helpful to you?YesNoReport abuse
33 of 34 people found the following review helpful
on October 24, 2010
This book is not for the newbie JavaScript programmer (for the complete beginner I suggest JavaScript: The Missing Manual). It assumes some deep knowledge about the language and one is well advised to have read Douglas Crockford's JavaScript: The Good Parts before venturing into this book. Having said that, this book is just simply amazing!. It is very obvious that the author knows his subject, knows how to write and knows what problems people actually have. This is no small feat, as most programming books usually fails in one or more of these areas.

The book covers numerous inheritance and code reuse techniques, including most of the GOF patterns, but does also suggest several novel ways to take advantage (and not hack around) JavaScripts prototypical nature. I especially liked the code "tours", where the author spends considerable time developing a solution step by step, demonstrating pitfalls and side effects while simultaneously anticipating questions the reader might have. These JavaScript vistas has added considerably to my knowledge of the language, and I expect I will comeback to them again in the future (this book can easily take a second and third reading).

In summary, a very elegant written book containing an incredibly amount of knowledge, at a great price. Quite possible the best book on JavaScript in existence - highly recommended.
11 commentWas this review helpful to you?YesNoReport abuse
24 of 25 people found the following review helpful
on December 5, 2010
If you're a JavaScript developer, you would be wise to have this on your bookshelf--nestled nicely between JavaScript: The Good Parts and High Performance JavaScript (Build Faster Web Application Interfaces). The three make a nice little troika.

And read them in that order: The Good Parts, Patterns, and then High Performance.

Here's why:

What Stefanov gives us with this book is effectively an overview [1] of best practices for JavaScript development, going over the benefits and gotchas of certain important language features, and translating those into design and implementation patterns. Many of these patterns are language-agnostic--and you're likely to recognize them from "The Gang of Four"--but Stefanov puts them in their JavaScript party dresses and takes them out to the ball. Wisely, Stefanov also presents these patterns in an environment/host-independent fashion, so the lessons you learn about encapsulation or inheritance or performance should be equally valid regardless of whether you're coding for the browser [2] or NodeJS or some image exporting automation for Adobe Illustrator. Stefanov is also a lucid and concise author, clearly illustrating his points about these design patterns; the text is accessible--easy to follow and digest--and he is careful to clearly define words and terms that might be ambiguous or commonly misunderstood (e.g., "function expression" vs. "function declaration" vs. "function literal").

JavaScript patterns makes a great transition guide for intermediate developers--the men and women who have stopped confusing jQuery-the-library with JavaScript-the-language--the folks who are ready to re-evaluate their approach software development with JavaScript. This is for the folks that made it through Crockford's The Good Parts knowing that they learned something but also feeling less-than-certain about how to apply that something. This is the follow-on; JavaScript Patterns is the application of those lessons. And then after you've written your clean, maintainable, scalable applications--then you make the jump to Zakas' High Performance JavaScript to tune things just a little bit further.

So you're probably wondering then: if you recommend it so highly, why only four stars?

The four stars comes mostly from two niggling points:

(1) Relative to The Good Parts and High Performance, JavaScript Patterns was not published in the order that I recommend reading them. As a consequence, since I'd read the others (and quite a few others above and beyond those two), there is quite a bit of information in there that I'd seen before. This is not a Bad Thing; sometimes it pays to see information presented again--to help it sink in or else to gain another perspective on it. And in some cases Stefanov offers an as-good-or-better explanation on certain topics/techniques as others writing in the field (e.g., his examples for memoization and currying rival Crockford's, and his explanation of the pub/sub pattern (and custom event design) is more concise than the one Zakas presents in Professional JavaScript for Web Developers). Sometimes (and I've written this before) you were just hoping for... just a little bit more.

(2) And this is super nit-picky but... The book could have taken another quick editorial pass for spelling and grammar. The one that stuck out at me was right in the intro to Chapter 6: "But it's important to keep the end goal in mind--we want to reuse cod;." Indeed.


1 : An in-depth overview, but an overview nonetheless.

2 : Stefanov is careful to "keep the browser out of it" and dedicates only one chapter (Chapter 8: DOM and Browser Patterns) to the subject; though everyone's favorite host environment does creep in a couple of times, in a couple of examples.
0CommentWas this review helpful to you?YesNoReport abuse
21 of 23 people found the following review helpful
on November 3, 2010
This book is really awesome, from the beginning to the end, the author shows useful tools to improve the javascript programming.

With more than 30 patterns the author goes from basic concepts, such as avoiding globals, using single var declarations, precaching length in loops, following coding conventions, running JSLint, etc., to advanced ones like variable hoisting, select algorithms at runtime, proxy objects, loading strategies, javascript optimization and a lot of more.

What I liked about the book was the way in which the author explains and illustrates the patterns and how well organized the book is written, this book helped me to understand in a better way some javascript techniques with several solutions to a common scenarios.

I recommend this book if you want to write better code, if you want to understand how the libraries are written or if you want to write your own javascript library. It helps a lot to understand the javascript core and the fundamentals and helps also to be more productive taking care of performance and maintenance of javascript code.
0CommentWas this review helpful to you?YesNoReport abuse
8 of 9 people found the following review helpful
on February 2, 2015
I purchased this book to read after I saw a former colleague reading this book on the train. It is an interesting book with some serious flaws.

There are two serious errors in chapter 4, Functions. The first error is about function declaration statements. The author claims "their definitions cannot be assigned to variables or properties, or appear in function invocations as parameters". I tried in both Chrome and Firebug console, and both proved this statement is incorrect.

The other error is about the "this" reference in the callback function (page 65). "If findNodes() was defined as a method of an object called dom, then 'this' inside of the callback would refer to dom instead of the expected myapp". This is completely wrong given the invocation pattern of callback in findNodes(). "this" used in the paint() function will always point to the global object (window in a browser), or undefined in ES5 strict mode. The author has made an error often made by very inexperienced javascript programmers!

Chapter 6, Code Reuse Patterns, is another interesting chapter in which the author claims "You should always strive for picking a modern pattern", but in reality, since he gives such a good and thorough discussion of the "Classical Pattern" while a very light treatment of the "Modern Prototypal Pattern", it is more likely readers would be convinced the classical pattern is a better alternative for inheritance in javascript :-)
44 commentsWas this review helpful to you?YesNoReport abuse
12 of 15 people found the following review helpful
on March 11, 2012
A grab bag of practices and techniques for JavaScript development for the core language and some browser specific concerns. The Essentials, Literals and Constructors, Functions, Object Creation Patterns, and Code Reuse Patterns chapters mostly rehash material from JavaScript: The Good Parts. The author provides additional exposition on the concepts but doesn't introduce much new material. The Design Patterns chapter includes some good examples of JavaScript implementations but accurately points out many already exist in third party libraries. The DOM and Browser Patterns chapter provides a brief introduction to browser specific concepts and concerns but you'll want to consult the referenced books for more detailed discussions. This book is a great primer for JavaScript development due to the breadth of topics is covers but is worth a pass if you've already read other JavaScript books covering these topics.
11 commentWas this review helpful to you?YesNoReport abuse
6 of 7 people found the following review helpful
on March 17, 2011
Stoyan does a great job of introducing and explaining JavaScript patterns that are in use today. He does not shy away from advanced topics and packs an impressive amount of high-quality material into 200 pages. I think a lot of people who want to learn JavaScript quickly turn to JavaScript: The Good Parts because its brevity appeals to them, but I think most of those people would be better served starting with Stoyan's book, even though it is more advanced. Stoyan's explanations are thorough, so newcomers who are eager to learn, will.

For example, one of the particularly tricky topics is the pattern for emulating "classical inheritance" in JavaScript. Fortunately, Stoyan walks through this carefully in Chapter 6, building up to the "Holy Grail" example, giving the right amount of detail that this topic deserves. He follows with alternative code reuse patterns, but does a great job in objectively discussing the tradeoffs between the various patterns.

I also appreciated how DOM/browser-specific patterns were separated into their own chapter (Chapter 8), and that the majority of the book focuses on patterns that universally apply to JavaScript, independent of the environment in which it is used. Thus, everything in chapters 1-7 is just as applicable in the browser as it is on a NodeJS server or in the Windows Script Host.

Finally, it's worth noting that I found impressively few errors in this book. Some technical books are riddled with errors (particularly in the code samples), sending people down the wrong path, but not this one! Clearly a lot of care went into producing this manuscript -- well done!
0CommentWas this review helpful to you?YesNoReport abuse
2 of 2 people found the following review helpful
on April 22, 2013
If you are a person trying to take Javascript seriously, this plus other books will help you to get to pro status. It's good to be abreast of what is acceptable in the higher Javascript echelons.

If you are tired of piece-mealing javascript code in a hackneyed and haphazard way without understanding how things work under the hood; this book will go along great with HIGH PERFORMANCE JAVASCRIPT by Nicholas C. Zakas who has Stoyan Stefanov in that book as well writing a chapter.

If you aspire to be a web lead this book and the aforementioned book are a must if you are an intermediate Javascripter climbing the ranks.

The book has good pace and is compartmentalized well so as not to overwhelm you. This book is not for beginners but if you are wanting to challenge yourself I think a beginner having a background with at least some computer science can figure it out.

Most other books I did not buy in print. These I did. They are not unnecessarily large and the content is structured in a way that you can read away from a computer. If you have a team of Developers, DEFINITELY get it in print. If you are a freelancer enjoy in either format. Hope this review helps you. KEEP LEARNING!
0CommentWas this review helpful to you?YesNoReport abuse
4 of 5 people found the following review helpful
on December 14, 2010
In my (seemingly) never-ending quest to improve my JavaScript skills, I recently received a copy of JavaScript Patterns by Stoyan Stefanov. While I feel very comfortable with jQuery and simple Ajax applications, I feel like I'm still missing... something in terms of constructing JavaScript heavy applications, especially those used within Adobe AIR applications. A few months back I reviewed Object-Oriented JavaScript which was also by Stefanov. JavaScript Patterns is an excellent followup and I'd definitely recommend it.

The book begins by discussing some JavaScript basics - just to ensure you have a proper understanding of what is - and what is not - supported in terms of object, inheritance, classes, etc. Issues surrounding variables and the global object are also discussed. Probably the most interesting aspect of the first portion to the book was the discussion on JSLint, a JavaScript code quality tool. Shoot - I didn't even know code quality tools existed for JavaScript before reading this book.

The middle section of the book was a bit difficult for me. Stefanov spends a lot of time talking functions and defining them. He also spends an incredible amount of time discussing object creation patterns. I had a very hard time with this. I get that there isn't "One Right Way" to solve a problem. I preach that all the time in the ColdFusion community. But I found a lot of this discussion to be hard to relate to. It's not that he doesn't provide examples. He does - quite a few. But I had a hard time relating them to practical uses in my own development. I decided to not stress out too much over it and return to the chapter later on. I had the same trouble with the section on inheritance. I just don't see myself needing inheritance yet in my development.

The final two chapters though were really exciting. Chapter 7 is on "Design Patterns." I feel like I've just recently gotten a hang on them in general - both in the ColdFusion and ActionScript world. Seeing them discussed in JavaScript and "getting it" was a great feeling. Chapter 8, "DOM and Browser Patterns", was also great. Some of the material I already knew but Stefanov covered them in a fresh way that helped really bring home the concepts.

I'd definitely recommend picking the book up (and as a reminder, if you click via the pretty picture above I get a kickback) as well as the previous one I reviewed. Both together would be a great way to lift your JavaScript development up to a new level. While I still think I've got a lot to learn, I'm feeling more comfortable in terms of approaching larger, more complex JavaScript based applications now.
0CommentWas this review helpful to you?YesNoReport abuse
3 of 3 people found the following review helpful
on October 2, 2014
I don't recommend many programming books, but this one is great. It's a must have for anyone that does serious javascript development, especially for applications.
0CommentWas this review helpful to you?YesNoReport abuse
Customers who viewed this also viewed
JavaScript: The Good Parts
JavaScript: The Good Parts by Douglas Crockford (Paperback - May 2008)

The Principles of Object-Oriented JavaScript
The Principles of Object-Oriented JavaScript by Nicholas C. Zakas (Paperback - February 23, 2014)

Send us feedback

How can we make Amazon Customer Reviews better for you?
Let us know here.