addyosmani / essential-js-design-patterns

Repo for my 'Learning JavaScript Design Patterns' book
http://addyosmani.com/resources/essentialjsdesignpatterns/book/
4.82k stars 792 forks source link

Patterns mention other Patterns and terms before they appear #114

Open rps opened 10 years ago

rps commented 10 years ago

There are two issues I noticed with the order of patterns in the book:

  1. The Module section mentions the Singleton Pattern, which is not covered for two sections:

"We’ve seen why the Singleton pattern can be valuable"

  1. The Observer section mentions the term Concrete. This is not explicitly defined until Command Patterns, three sections later.

"Concrete classes are best explained in terms of class-based programming languages"

Changing the location of / reference to these terms will improve the presentation of the ideas.

addyosmani commented 10 years ago

Thanks for the head's up, @rps. I'll try to address the order so that this makes more sense.

addyosmani commented 10 years ago

he Constructor and Prototype patterns are very similar but are separated by five other less closely-related patterns. I think the presentation of these two patterns would be considerably amplified were they presented sequentially, with a discussion of the differences between the new operator and the Object.create method. I think there's also a case to be made for grouping these two directly above Factory, Mixins and Decorators to really drive the ideas home.

from your other reported issue. Will address both in one go.