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

by
4.17  ·  Rating details ·  1,564 ratings  ·  68 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
Paperback, 216 pages
Published September 28th 2010 by O'Reilly Media (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

Community Reviews

Showing 1-30
Average rating 4.17  · 
Rating details
 ·  1,564 ratings  ·  68 reviews


More filters
 | 
Sort order
Start your review of JavaScript Patterns
Rob
Oct 25, 2010 rated it really liked it
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
...more
Adrian Li
Dec 23, 2016 rated it really liked it
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
...more
Xanan
Mar 25, 2020 rated it really liked it
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
...more
Petar Ivanov
Aug 19, 2020 rated it it was amazing
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!
Greenicicle
Feb 28, 2011 rated it liked it
Shelves: development
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
...more
Johnny
Mar 17, 2014 rated it liked it  ·  review of another edition
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
...more
Kumanan Murugesan
Aug 14, 2012 is currently reading it
Learning a lot of stuff from this book. Very interesting and very useful.
David Zukowski
Goodreads fix your broken UX please.
Harvey
Sep 09, 2017 rated it really liked it
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.
Dave Lorentz
Nov 27, 2017 rated it it was amazing
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
basics or not so basics, but anyone should know these patterns
Marcus
Mar 19, 2016 rated it it was ok
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
...more
Rod Hilton
Mar 17, 2011 rated it it was amazing
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
...more
Daniel R.
Feb 26, 2012 rated it liked it
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
David
Aug 18, 2011 rated it liked it
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
...more
Ryan Boone
Jan 19, 2015 rated it really liked it  ·  review of another edition
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
...more
Sergiu Ciumac
Nov 04, 2012 rated it really liked it
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.
ifknot
Apr 06, 2016 rated it liked it
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.
Anton Antonov
Oct 23, 2016 rated it really liked it
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
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.
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
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
Jan 08, 2014 rated it it was ok
Shelves: faglitteratur
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
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.
Nivesh
Feb 01, 2016 rated it it was amazing
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.
Nikola
Jul 05, 2012 rated it it was amazing
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
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.
Dan
Jun 06, 2014 rated it really liked it  ·  review of another edition
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.
Alex
Jul 15, 2014 rated it really liked it
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.
Illia Olenchenko
Jan 18, 2015 rated it really liked it
I like part with patterns in the middle and a lot of parts in the beginning and the end. but from 260 pages realy usefull was only 120-160. And after reading find way to trane your new skills in live.
« 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
  • Eloquent JavaScript: A Modern Introduction to Programming
  • You Don't Know JS: Up & Going
  • Clean Code: A Handbook of Agile Software Craftsmanship
  • The Pragmatic Programmer: From Journeyman to Master
  • Secrets of the JavaScript Ninja
  • Cracking the Coding Interview: 150 Programming Questions and Solutions
  • You Don't Know JS: Scope and Closures (You Don't Know JS, #2)
  • Head First Design Patterns
  • You Don't Know JS: Types & Grammar
  • The Principles of Object-Oriented JavaScript
  • Design Patterns: Elements of Reusable Object-Oriented Software
  • Pro Git
  • The Clean Coder: A Code of Conduct for Professional Programmers
  • You Don't Know JS: this & Object Prototypes
  • HTML and CSS: Design and Build Websites
  • Code Complete
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

It’s time to turn your attention to something dark and twisty, to a story (or two or three) so engaging, the pages just fly by. In short, it’s...
40 likes · 10 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…