Goodreads helps you keep track of books you want to read.
Start by marking “JavaScript Patterns” as Want to Read:
JavaScript Patterns
Enlarge cover
Rate this book
Clear rating
Open Preview

JavaScript Patterns

4.17  ·  Rating details ·  1,591 ratings  ·  69 reviews
What's the best approach for developing an application with JavaScript? This book helps you answer that question with numerous JavaScript coding patterns and best practices. If you're an experienced developer looking to solve problems related to objects, functions, inheritance, and other language-specific categories, the abstractions and code templates in this guide are id ...more
Kindle Edition, 236 pages
Published (first published September 1st 2010)
More Details... Edit Details

Friend Reviews

To see what your friends thought of this book, please sign up.

Reader Q&A

To ask other readers questions about JavaScript Patterns, please sign up.

Be the first to ask a question about JavaScript Patterns

This book is not yet featured on Listopia. Add this book to your favorite list »

Community Reviews

Showing 1-30
Average rating 4.17  · 
Rating details
 ·  1,591 ratings  ·  69 reviews

More filters
Sort order
Start your review of JavaScript Patterns
Oct 25, 2010 rated it really liked it  ·  review of another edition
Recommends it for: would-be intermediate and intermediate JavaScript developers looking for more sophistication
Shelves: 2010, javascript, own
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 . 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 [†] of best practices for JavaScript development, going over the benefits and gotchas of certain important language features, and tr
Adrian Li
Dec 23, 2016 rated it really liked it  ·  review of another edition
This is a good book and most people who work with Javascript should spend at least a couple hours going through it. But there is a caveat: it is old.

This book was published in 2010, and there are many things that are talked about, which we really don't have to worry about anymore. In this book, there are many IIFE examples that are no longer needed in the world of ES2015 and beyond (i.e. ESNEXT).

In any case, you need to read through this book in a smart manner. Don't force yourself to go through
Mar 25, 2020 rated it really liked it  ·  review of another edition
A valuable reading even if a bit outdated.

The book describes a collection of tips, best practices and patterns that can help you to use JavaScript effectively, solve common problems, make your code more readable and reusable.

Some of the patterns described are actually already implemented in popular JavaScript libraries and frameworks, but even if you might end up not having to use some it's always a good thing to have them in your toolbox.

The book assumes fluent JavaScript knowledge and only cov
Petar Ivanov
Aug 19, 2020 rated it it was amazing  ·  review of another edition
Shelves: computer-science
Really great book about some more advanced JavaScript concepts. There are a lot of examples and good explanations. It's not for beginners but it's very helpful for people who want to dig deep into the language. Recommend it to every JS software craftsman! ...more
So far I'm a little disappointed that practices like "write sensible comments" and "indent properly" are really listed as patterns, especially when the book claims to be targeted to professional devs. But I've still got a bunch of pages to go through.

UPDATE: Finished now. The title does not lie: the book is full of patterns. There is a focus on organizational patterns (object creation, inhheritance). Of these, there is a large variety of variants; mostly presented in an evolutionary chain the le
Mar 17, 2014 rated it liked it
Only a small part of JavaScript Patterns is about design patterns. Much more pages are spent on best practices and the deployment story. While these parts are very useful, they may not be what you are looking for.
The Singleton pattern is a one example I like to pick to illustrate some of the problems with the book. In books about design patterns for other languages like Ruby that doesn’t have the concept of a Singleton, the explanation of the pattern is simply: Not supported here. In his book S
Kumanan Murugesan
Learning a lot of stuff from this book. Very interesting and very useful.
David Zukowski
Goodreads fix your broken UX please.
Sridhar Raj Sampath Kumar
The book is comprehensive in terms of patterns and examples. Though some portion of it is outdated, still you'll have something to learn in terms of how they addressed the design problems prior to ES2016. ...more
Sep 09, 2017 rated it really liked it  ·  review of another edition
Shelves: programming
Some of the author's suggestions about how to handle loading of JS are getting quite dated, but the discussion of design patterns is still worth buying this book. ...more
Dave Lorentz
Nov 27, 2017 rated it it was amazing  ·  review of another edition
Do not re invent the wheel! Patterns are a cornerstone of systems design and this book shows how they can be applied. I would like to see data access patterns added, especially now that HTML5 is so wide spread. But that does not take away from the good set of patterns described here.
Paul Pacurar
Sep 28, 2016 rated it it was amazing  ·  review of another edition
basics or not so basics, but anyone should know these patterns
Mar 19, 2016 rated it it was ok  ·  review of another edition
Let me start by presenting my 'credentials' in the field - I have two decades of programming experience in different object-oriented languages, mainly in .NET platform and SQL. Most of the time I deal with client-server applications in Windows environment. Over last couple of years I started increasingly dabbling with HTML5 and JavaScript, a challenge which I admit freely is not very enjoyable to me mostly due to JavaScript's chaotic nature (in my opinion at least).
When I reached for this partic
Rod Hilton
JavaScript Patterns was the first book that made me feel like I really *GOT* JavaScript. I've come away with a much greater appreciation for the language than I used to have, and I feel much more comfortable with the idiotmatic usage of the language.

The book, written by a Senior Yahoo! programmer, is more than just a "here is how to do the XYZ Design Pattern from the GOF book in JS" (though it has quite a bit of that at the end). It's really a book about patterns that have evolved out of JavaScr
Daniel R.
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 point ...more
Aug 18, 2011 rated it liked it  ·  review of another edition
This book covers a lot of different patterns, and is a useful tour. Even experienced programmers will likely learn patterns they haven't seen before. The author's commentary is thoughtful and helps the reader evaluate pros and cons, though I think the author is not sufficiently critical of weaker techniques. Many of them are fine for small programs but don't scale well for larger ones (i.e., are not very maintainable or extensible or automatically checkable).

The bigger problem is that, like Java
Ryan Boone
Jan 19, 2015 rated it really liked it
Crucial source for JS developers

JS Patterns is a well-thought out and executed resource that introduces and explains many common, helpful patterns that modern-day web and app developers will find invaluable. Stefanov clearly explains the reasoning behind each pattern, common problems they solve, as well as usage examples and source code. This book is legendary among the JS community, and it's not hard to see why. I only wish this were more updated.

I would love to see some ES6 implementations, a
Sergiu Ciumac
Nov 04, 2012 rated it really liked it  ·  review of another edition
Nicely written book. Though, I would not consider programming JavaScript using practices and patterns from OOP. I find it as an overkill implementing Object Oriented patters in a language which was designed as an event-driven, and does not support the concept of classes. Moreover, I would consider this as an anti-pattern, as it introduces a lot of misconception and non-intuitive constructs.
Overall, it brought some interesting points about JS, though a lot of them are not useful.
Apr 06, 2016 rated it liked it  ·  review of another edition
Shelves: comp-sci
A good compliment to Crockford's book if a little less opinionated, and less entertaining as a consequence. Having been convinced by Crockford that Javascript is a different, functional language it is a bit surprising to then have Stefanov use a lot of space to show how to bend Javascript to mimic the traditional class based OOP model. The remainder is good and the patterns implementations useful but for the Singleton pattern - which, for many, is now regarded as an anti-pattern. ...more
Anton Antonov
Oct 23, 2016 rated it really liked it  ·  review of another edition
Good JS design patterns book.

Before Addy Osmani's JS Design Patterns book, this book was my go-to choice.

The reason why I give it a 4/5 is that it's not as accessible as Addy Osmani's.

It starts as an uphill battle for newer JS developers looking into design patterns and some concepts are harder to get than in the later book.

Still a solid design patterns resource and definitely a go-to choice for people that are more experienced.
Dmitry Petrov
Nov 29, 2010 rated it really liked it  ·  review of another edition
Shelves: programming-read
The book introduces common solutions of problems that come into the view of every javascript developer starting from the code style and ending with realization of some OOP patterns. Information is not outdated and "JS patterns" will be a good choice if you do not need another language syntax description but want to figure out, how it works in the real world. ...more
Wout Mertens
Jun 07, 2011 rated it it was amazing  ·  review of another edition
In-depth review of patterns you'll need or encounter while writing JavaScript code. All patterns are clearly explained so that you understand their reason for existence as well as how to apply them yourself.

It's rather dry though, and expects a moderate familiarity with JavaScript so it should not be the first book you read when learning JavaScript.
Carl Ostberg
Oct 03, 2011 rated it really liked it  ·  review of another edition
I wish i remembered more parts of this. Redefining constructors during their construction to only do setup work once sounds handy. Preloading js for other pages is something i need to think about doing more. Mainly though this book is about what not to do, would probably want to refer to this again repeatedly while working to really internalize the lessons.
Carl-Erik Kopseng
Quite comprehensive, but mindnumbingly boring. There are better intros to good JavaScript (see Test Driven JavaScript by Johansen), and there are few patterns besides best practices. The last bit has some good performance tips on preloading and lazy loading. Otherwise a definite waste of your time if you know your way around closures, ES5, and basic design patterns. Nothing new.
David Guaraglia
Feb 12, 2014 rated it it was amazing  ·  review of another edition
If you ever come from a different programming language into the world of modern Javascript, this book is a lifesaver as it introduces you to a number of patterns and 'common sense' conventions that have sprouted over the years as Javascript evolved into the powerful (if messy and difficult to modularize) language it is today. ...more
Feb 01, 2016 rated it it was amazing  ·  review of another edition
This book will help you explore the hidden secrets of JavaSript, along with letting light on the design patterns defined by the 'Gang of Four'.
Note: One is only qualified to read this book if one has read "JavaScript: The Good Parts" atleast 2 times, meaning concepts should be clear before reading it. It simply takes you to more higher level than you where before reading it.
Jul 05, 2012 rated it it was amazing  ·  review of another edition
Shelves: development
Really great book - essential for everyone that wants to write maintainable and structured code. I picked it up because since I started writing more client-centric apps, I felt that my JS lacks organization and structure. This book showed me how things should be done.
Marshall Upshur
May 24, 2013 rated it it was amazing  ·  review of another edition
Great book, showing you some great patterns for regular JS development (modules, function constructors, etc), as well as some classic Gang of Four patterns in JS. Read straight through, but could also be used as a reference of sorts to get an idea on certain things and how they are done regularly.
Jun 06, 2014 rated it really liked it
A solid introduction to a variety of best practices in JavaScript. While the theoretical aspects are interesting (singleton implementation isn't really relevant), the book could've been even more concise without them. ...more
Jul 15, 2014 rated it really liked it  ·  review of another edition
A tad bit old now, but still very relevant.

If you're coming over from another language this is an excellent book to read, it should help break the Classical shackles you may be wearing so you're free to adopt a prototypal way of thinking.
« previous 1 next »
There are no discussion topics on this book yet. Be the first to start one »

Readers also enjoyed

  • JavaScript: The Good Parts
  • JavaScript: The Definitive Guide
  • Clean Code: A Handbook of Agile Software Craftsmanship
  • Eloquent JavaScript: A Modern Introduction to Programming
  • You Don't Know JS: Up & Going
  • The Pragmatic Programmer: From Journeyman to Master
  • Head First Design Patterns
  • Secrets of the JavaScript Ninja
  • Effective TypeScript: 62 Specific Ways to Improve Your TypeScript
  • High Performance JavaScript
  • Cracking the Coding Interview: 150 Programming Questions and Solutions
  • Sams Teach Yourself SQL™ in 10 Minutes
  • The Clean Coder: A Code of Conduct for Professional Programmers
  • You Don't Know JS: Scope and Closures (You Don't Know JS, #2)
  • You Don't Know JS: Types & Grammar
  • You Don't Know JS: this & Object Prototypes
  • The Manager's Path: A Guide for Tech Leaders Navigating Growth and Change
  • Strange Pilgrims
See similar books…

Goodreads is hiring!

If you like books and love to build cool products, we may be looking for you.
Learn more »

News & Interviews

When it comes to the romance genre, second books can be a bit like second dates, can't they? You've had that great initial meet-cute with...
43 likes · 2 comments
“you have the freedom to return any object in your constructors, as long as it’s an object. Attempting to return something that’s not an object (like a string or a boolean false, for example) will not cause an error but will simply be ignored, and the object referenced by this will be returned instead.” 0 likes
“In JavaScript there’s no curly braces local scope; in other words, blocks don’t create scope. There’s only function scope.” 0 likes
More quotes…