r/javascript • • Dec 19 '15

4 JavaScript Design Patterns You Should Know

https://scotch.io/bar-talk/4-javascript-design-patterns-you-should-know
1 Upvotes

6 comments sorted by

View all comments

5

u/madole Dec 20 '15 edited Dec 21 '15

The Singleton is the single most painful pattern (or anti pattern) I've had the displeasure of working with.

Don't get me wrong, they have use cases, but they are rarely implemented correctly in Javascript and I'd say 99% of the time if you're finding yourself wanting to implement a singleton, you've taken a wrong architecture decision at some point that you might want to reevaluate.

2

u/kbailles Dec 21 '15

Singleton; untestable garbage.