Shop top categories that ship internationally
Buy used:
EUR 11.11
EUR 7.88 delivery Friday, May 8. Order within 8 hrs 53 mins
Or fastest delivery Wednesday, May 6
Condition: Used: Good
Comment: Used book in good and clean conditions. Pages and cover are intact. Limited notes marks and highlighting may be present. May show signs of normal shelf wear and bends on edges. Item may be missing CDs or access codes. Ships directly from Amazon.
Access codes and supplements are not guaranteed with used items.
Only 1 left in stock - order soon.
{{numberOfItems}} item(s) added for {{price}}
Added to

Sorry, there was a problem.

There was an error retrieving your Wish Lists. Please try again.

Sorry, there was a problem.

List unavailable.
Kindle app logo image

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.

QR code to download the Kindle App

  • JavaScript Patterns: Build Better Applications with Coding and Design Patterns

Follow the author

Get new release updates & improved recommendations
Something went wrong. Please try your request again later.

JavaScript Patterns: Build Better Applications with Coding and Design Patterns 1st Edition

4.4 out of 5 stars (347)

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 ideal―whether you're using JavaScript to write a client-side, server-side, or desktop application.

Written by JavaScript expert Stoyan Stefanov―Senior Yahoo! Technical and architect of YSlow 2.0, the web page performance optimization tool―JavaScript Patterns includes practical advice for implementing each pattern discussed, along with several hands-on examples. You'll also learn about anti-patterns: common programming approaches that cause more problems than they solve.

  • Explore useful habits for writing high-quality JavaScript code, such as avoiding globals, using single var declarations, and more
  • Learn why literal notation patterns are simpler alternatives to constructor functions
  • Discover different ways to define a function in JavaScript
  • Create objects that go beyond the basic patterns of using object literals and constructor functions
  • Learn the options available for code reuse and inheritance in JavaScript
  • Study sample JavaScript approaches to common design patterns such as Singleton, Factory, Decorator, and more
  • Examine patterns that apply specifically to the client-side browser environment

Customers also bought or read

Loading...

From the brand

Editorial Reviews

About the Author

Stoyan Stefanov is a Yahoo! web developer, Zend Certified Engineer, and an author, contributor, and tech reviewer of various O'Reilly books. He speaks regularly about web development topics at conferences and on his blog at www.phpied.com. Stoyan is the creator of the smush.it image optimization tool and architect of Yahoo's performance optimization tool YSlow 2.0.

Product details

  • ASIN ‏ : ‎ 0596806752
  • Publisher ‏ : ‎ O'Reilly Media
  • Publication date ‏ : ‎ October 26, 2010
  • Edition ‏ : ‎ 1st
  • Language ‏ : ‎ English
  • Print length ‏ : ‎ 232 pages
  • ISBN-10 ‏ : ‎ 9780596806750
  • ISBN-13 ‏ : ‎ 978-0596806750
  • Item Weight ‏ : ‎ 2.31 pounds
  • Dimensions ‏ : ‎ 7 x 0.6 x 9.19 inches
  • Best Sellers Rank: #1,704,156 in Books (See Top 100 in Books)
  • Customer Reviews:
    4.4 out of 5 stars (347)

About the author

Follow authors to get new release updates, plus improved recommendations.
Stoyan Stefanov
Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

Stoyan Stefanov leads a double life as a musician and a technologist in Los Angeles. In technology, he has twenty years of experience at the forefront of web programming and web performance in companies including Facebook/Meta/Instagram, Yahoo!, and SAP. As a thought leader and inventor, he has published about a dozen programming books and spoken at countless conferences around the world.

During his tech career, Stoyan has also played in several rock bands as a guitarist and songwriter, but it wasn't until Fall 2016 that he got serious about the art and craft of music. He started taking classes at Santa Monica College and the University of California, Los Angeles, in music theory, composition, conducting, orchestration, guitar, piano, viola, and more. Always curious, Stoyan is enchanted by anything and everything to do with music, from soldering audio gear to composing concert music, from collaborating with musicians on a song to recording, mixing, and releasing it. He has a single-item bucket list: to write orchestral music worthy of performance by the Los Angeles Philharmonic.

At the intersection of technology and music, Stoyan created and maintains OnlineMusicTools and SiteReadOrg: free websites for learning and improving the musicianship and theory skills of music students and practitioners.

Customer reviews

4.4 out of 5 stars
347 global ratings

Customers say

Customers find this JavaScript book excellent for intermediate to advanced developers, explaining complex concepts in clear detail with well-structured examples. The book approaches the language systematically and is easy to understand, with one customer noting it's particularly useful for day-to-day coding. Customers appreciate the author's expertise, and one review highlights how it compares and contrasts good patterns with anti-patterns.
AI Generated from the text of customer reviews

Select to learn more

73 customers mention content, 68 positive, 5 negative
Customers find this JavaScript book excellent for intermediate to advanced developers, offering sound advice on writing better code and providing an awesome way to explain complex concepts.
Great book. Easy read with lots of examples.Read more
Excellent book! Lots of good examples. Some great tips which were immediately useful in my day to day coding.Read more
...It's a good read and reference.Read more
...This is also fantastic book to get to know the recommended ways of doing things in JavaScript, explaining each topic and pattern on well described...Read more
49 customers mention detailed, 45 positive, 4 negative
Customers find the book detailed and informative, with clear explanations of each topic and well-described examples.
Good practical advice describing the design patterns to follow when coding JavaScript well as the anti-patterns to avoid....Read more
Grate book, To the point, no talking and teaches you how to write batter JavaScript....Read more
This is an excellent book with balanced pace & insight - easy to understand examples with good key points....Read more
Excellent book! Lots of good examples. Some great tips which were immediately useful in my day to day coding.Read more
24 customers mention readability, 17 positive, 7 negative
Customers find the book easy to understand, with lots of examples and extremely clear content. One customer mentions that the code is short and easily readable.
...Code I didn't quite understand before was easy to understand after learning about the patterns it was using.Read more
...of few pages you will find the answers you need... nicely written, clear and concise in comparison with 'big reference bibles books'....Read more
...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...Read more
...JavaScript continues to amaze me with it's simple yet powerful abilities; without this book powerful aspects of the language may have completely...Read more
22 customers mention design patterns, 20 positive, 2 negative
Customers appreciate the book's coverage of design patterns in JavaScript, with one customer noting how it compares and contrasts good patterns with anti-patterns.
JS Patterns is a well-thought out and executed resource that introduces and explains many common, helpful patterns that modern-day web and app...Read more
...And read them in that order: The Good Parts, Patterns, and then High Performance. Here's why:...Read more
...JavaScript i never found out about from online researching-- OOP, design patterns, best practices--in great depth....Read more
...a light bulb above my head from the moment I started reading, chalk full of patterns and anti-patterns for writing/architecting good JavaScript....Read more
14 customers mention writing quality, 14 positive, 0 negative
Customers praise the writing quality of the book, finding it extremely well written, with one customer specifically noting its effectiveness in teaching clean JavaScript coding.
...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...Read more
...It is very obvious that the author knows his subject, knows how to write and knows what problems people actually have....Read more
This is one of my all time favorite books. Extremely well written, covers the content in an easy to follow manner, and gives excellent examples....Read more
The author has done a great job in writing this book. For me, this book acted as a bridge that helped me further my JavaScript knowledge....Read more
11 customers mention language, 8 positive, 3 negative
Customers appreciate the book's systematic approach to the language and find it concise, with one customer noting the clear definition of words.
I started out learning JavaScript with this book. It is very clean, concise and progresses in a very logical manner....Read more
...JavaScript programmer can buy to skill up even more in this beautiful language. If you know the basics od JavaScript (syntax, operators, etc.)...Read more
A good read if you want to know why Javascript is a terrible language....Read more
...First off: Everything is explained very clearly and concisely....Read more
11 customers mention usefulness, 10 positive, 1 negative
Customers find the book immensely useful, with one mentioning its practical application in day-to-day coding and another highlighting its value in the JavaScript ecosystem.
...I'm very happy with this book and I expect it to be a useful resource for a long time to come. Kudos to the author!!!Read more
...modules, GoF design patterns, and API development that are of immediate practical use....Read more
While useful , this book badly needs an update it was written based on ES5. It is way behind, needs at least an ES6 update....Read more
This book has served as an invaluable tool for software development and will continue to do so for the years to come as the JavaScript ecosystem...Read more
6 customers mention author, 6 positive, 0 negative
Customers appreciate the author of the book, describing him as wise and knowledgeable about his subject matter, with one customer noting that his tone is light.
...It is very obvious that the author knows his subject, knows how to write and knows what problems people actually have....Read more
...But now I'm sold, and its due to this clear and wise author. Thanks Stoyan.Read more
...Author has done a great job!!Read more
...Stefanov is also a lucid and concise author, clearly illustrating his points about these design patterns; the text is accessible--easy to follow...Read more

Top reviews from the United States

  • Reviewed in the United States on March 13, 2011
    Format: PaperbackVerified Purchase
    I own the kindle and paperback versions of this book. An exceptional book!

    This is a must have if you are serious about javascript programming. It is NOT a beginner's book and it doesnt waste whole chapters on a beginning javascript tutorial. To read this book, you should already know something about using prototypes and closures in js.

    The first part of the book covers basic elements of the language such as types and declarations, for loops etc but this is a more advanced treatment. I learned something in every one of these sections. For example I had never really understood variable hoisting before.

    After that the book seems to cover all the topics in Crockford's Javascript The Good parts, but with more explanation. His writing is clear and straightforward. Many software authors really dont know how to write clear English and give rambling, confusing explanations. On the other end of the scale, I found Crockford's book a bit cryptic at times. Why would you do inheritance this way?? Stefanov explains. You don't really need Crockford's book if you have this one. But JS The Good Parts is a classic.

    The code examples are short and succint. This is not a cook book, nor a book with apps stretching over pages. In one chapter he does cover a complete app in some detail. But for the most part the code is short easily readable snippets well chosen to make his point. But this is not a code snippet resource. The examples he does give are written for clarity and are not optimized. Nor are they cluttered with code for dealing with special cases. You can find more sophisticated implementations of all these ideas on the web. The goal is to get the core idea.

    The last part of the book covers such useful things as deployment, remote scripting and loading which are all very useful.

    OReilly is currently offering a special deal where if you buy the kindle version, you can then buy the printed version for $5 !!. Which means you can get both for less than Amazon's price for the book alone. In addition, OReilly allows you to download, for free, unrestricted copies of the book in PDF & Mobi format. This deal is a no brainer. Note: OReilly's price for the ebook is much higher than Amazon's, but if you buy it from Amazon , you still get all these extras.

    Cons: Doesn't cover ECMA 5 which is just coming out and includes some significant features and changes. I can't fault the author for that and the book is well worth it anyway. Doesn't discuss memory management which is a significant issue for the current version of JS with circular references causing memory leaks. This problem may go away in the new generation of browsers. Dunno. The book doesnt have a code download site. Even though this is not a cook book, I consider this a serious fault. It's nice to cut and past examples into a JS console and play with them as you read. Kindle for PC does not allow cut and paste. But in mitigation, The author's site has the code for the complete apps. I would have knocked off a star for this but in light of OReilly's generous offer and the fact that I would have rated this book 6 stars, I decided to let it go :)
    4 people found this helpful
    Report
  • Reviewed in the United States on September 26, 2012
    Format: PaperbackVerified Purchase
    Master and beginner JavaScript developers alike have a reason to thank Stoyan Stefanov- he did a fantastic job surveying the JavaScript landscape and mapping out key strategies for us to use in writing JavaScript applications large and small. He explains JavaScript and how to use it properly very well in this book.

    "JavaScript Patterns" is a thoughtful, thorough, and written manual on developing JavaScript applications in a patterns-based way. It excels in three main areas:

    First, it explains with clear examples the difference between classical (e.g. class-like as in C++, Java, C#) language idioms of which many of us are indoctrinated and the more modern, functional, loose-type style of JavaScript. It is a good sell, as he argues convincingly for a more free and open understanding of what an Object can be in a Object-Orientated architecture. Most worth noting is how it so clearly explains the variety, prominence, and role of Functions in the language.

    Second, it clearly shows through example many of the JavaScript "gotchas" like counter-intuitive hoisting rules and issues with unexpected typecasting. Each point comes with an example sophisticated enough to get the point across but without unneeded detail.

    Finally, it dives into richer examples of the classical design patterns (Singleton, Factory, Decorator...) and how to apply them in JavaScript well using many of the OO patterns discussed earlier in the text.

    High value in each Chapter

    The "signal to noise" ratio in this text is very high. Very often authors, most notably Crockford, will go down a rabbit hole of pedantic unimportant threads. Stefanov keeps us on a focused course dedicating the most time to the subjects that really are core and matter in the language: Functions, Global Scope and Modules, building Objects.

    The two exceptions to this are as follows:

    His survey of Classical inheritance patterns is too involved. He spends many pages discussing the minutiae of slight differences in applying classical inheritance patterns to JavaScript, only to later argue that none of them should be used. That could have been explained to us without the long fruitless journey.

    Some of the example Applications he uses to explain the patterns could have been refactored and simplified. Most notably his extended "Proxy" example missed the mark in trying to get the core pattern across because it was lost in too much unneeded application detail.

    CoffeeScript and JavaScript

    "JavaScript Patterns" is an absolute excellent text and can serve those writing server-side applications with JavaScript along with those using CoffeeScript to abbreviate the language. Even though CoffeeScript isn't mentioned, it explains the patterns that CoffeeScript uses when it compiles to JavaScript. To better understand what CoffeeScript is doing, read this book.
    2 people found this helpful
    Report

Top reviews from other countries

Translate all reviews to English
  • Tanmaya
    5.0 out of 5 stars Recommended to all javascript lovers
    Reviewed in India on December 27, 2018
    Format: PaperbackVerified Purchase
    This book explains JS patterns and basic concepts very clearly with examples. Topics are organised so wisely that it will generate interest to read the book. One of my best JS book so far. I recommend to all who has basic JS knowledge.
    Customer image
    Tanmaya
    5.0 out of 5 stars
    Recommended to all javascript lovers

    Reviewed in India on December 27, 2018
    This book explains JS patterns and basic concepts very clearly with examples. Topics are organised so wisely that it will generate interest to read the book. One of my best JS book so far. I recommend to all who has basic JS knowledge.
    Images in this review
    Customer image Customer image
  • Michael SILVESTRE
    5.0 out of 5 stars A book that all JS developers should read
    Reviewed in France on January 28, 2015
    Format: KindleVerified Purchase
    I really appreciate that book. It simple and don't use too much reference about main JS library such jQuery. It give advice about how to with good practice. It's easy to read and have a good place on my nightstand

    I recommend this book and mainly all the book of that collection.
  • R. Moenchmeyer
    5.0 out of 5 stars Exzellente Lektüre
    Reviewed in Germany on March 6, 2013
    Format: PaperbackVerified Purchase
    Ich entwickle serverseitig viel mit PHP5, u.a. für ein CMS-Framework. Javascript habe ich bisher lediglich für kleinere Applikationen/Animationen und im Zusammenhang mit Web-Formularen auf dem Browser eingesetzt. Natürlich kenne ich Flanagans einführendes Standardwerk. Und natürlich setze ich JQuery ein. Als extrem nützliches Framework überlagert und verdeckt JQuery aber die inherenten Möglichkeiten von Javascript durch eigene Strukturen und Interfaces.

    Da ich nun immer mehr mit Ajax arbeite und hierfür eine Art "Miniframework" auf der Client-Seite aufbaue, habe ich begonnen, mich mehr und mehr um grundsätzliche Strukturierungs- Möglichkeiten und Patterns von Javascript zu kümmern. Dabei bin ich dann auf das Buch von S. Stefanov gestoßen. Und habe es in vielerlei Hinsicht als eine kleine Offenbarung empfunden.

    Ich fand beim ersten Einstieg, dass der Autor ein ziemliches Tempo vorlegt und dass der Text sehr "dicht" geschrieben ist . Die ersten 50 Seiten sind zwar schnell überflogen. Aber das Niveau steigt dann schnell an. Kapitel 4, das versucht, dem Leser Funktionen als Objekte näher zu bringen, habe ich als ein Schlüsselkapitel empfunden. Alles, was danach kommt, fand ich erst dann in vielen Punkten spannend und lehrreich, nachdem ich Kapitel 4 nach zweimaligem Lesen ordentlich verdaut hatte. Aber so soll es sein - Mitdenken des Lesers ist zu Recht gefordert und es schadet nicht, immer mal wieder zurückzublättern.

    Ich persönlich fand das Spektrum an Struktur-, Reuse- und Design-"Patterns", die der Autor beispielhaft in den Kapiteln 6 und 7 diskutiert, als relativ praxisnah, weil man die Beispiele schnell auf eigene Anforderungen übertragen kann. Hat man zudem einmal eine "Pattern"-Lektüre wie etwa das ebenfalls ausgezeichnete Buch "PHP Design Patterns" von Stefan Schmidt hinter sich gebracht, so wird man sich freuen, zu einigen der dort diskutierten Haupt-Patterns nun eine entsprechende Variante unter Javascript vorgestellt zu bekommen. Spätestens jetzt kann man sich vorstellen, Javascript auch in ganz anderen Umgebungen als einem Browser einzusetzen. Kapitel 8 zu DOM und dem browserspezifischen Einsatz von Javascript fand ich ein wenig kurz geraten. Aber das trübt den sehr guten Gesamteindruck nicht wesentlich.

    Ich habe Stefanovs Buch inzwischen zum zweiten Mal gelesen. Und finde es nun exzellent. Der dichte Stil erwies sich beim erneuten Durchgang plötzlich als Vorteil. Ich finde auch, dass sich einem die didaktische Gedankenführung des Autors erst beim zweiten Lesen so richtig erschließt. Mein Respekt vor der Autor ist bei der zweiten Lektüre noch gestiegen.

    Fazit: Der Autor macht es einem im ersten Anlauf sicher nicht leicht, ihm zu folgen. Aber die Anstrengung, die der Leser investieren muss, lohnt sich wirklich: Javascript hat durch das Buch für mich eine neue Bedeutung bekommen. Ich bewerte das Buch deshalb als ausgezeichnete Lektüre.
    Report
  • Paul Barber
    5.0 out of 5 stars The focus is upon well designed code and good practices for writing maintainable JavaScript.
    Reviewed in the United Kingdom on March 8, 2015
    Format: PaperbackVerified Purchase
    Avoids falling into the trap of simple 'hello world!' tutorials. Instead the focus is upon on well designed code and good practices for writing maintainable JavaScript code. If you already understand the basics of programming (even if you're completely new to JavaScript) I'd suggest skipping the simple tutorials and jumping into this, it's both easy to follow and very informative.
  • Cliente Amazon
    5.0 out of 5 stars consigliatissimo
    Reviewed in Italy on May 2, 2018
    Format: PaperbackVerified Purchase
    ottimo libro per chi inizia a programmare in javascript. mi ha aperto un mondo che non conoscevo. un must da avere tra i propri libri