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.
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.