Singleton Pattern Debate
The cluster centers on discussions criticizing the singleton design pattern as equivalent to global variables, highlighting its drawbacks for testing and maintainability, while suggesting alternatives like passing instances or using dependency injection.
Activity Over Time
Top Contributors
Keywords
Sample Comments
Why are singletons worse than static methods?
People who use singletons deserve no better...
One more reason not to make singletons.
my (very tongue in cheek) favorite description of singletons - an object oriented way to break object orientedness.
modern patterns, but you include a singleton??? seriously, please reply to me if you actually implemented a singleton in the past 2 years
Singletons are just globals for people who have learnt "globals are bad" but lack a deeper understanding
Singletons are globals, aren't they?
Singletons are easy to implement, simple to understand and have no performance penalties. They don't need to be defended. If they work for your project, use them.
Imagine your example in a singleton pattern scenario. It would be quite a performance hit.
"Oh, it's just a singleton" - me after half an hour of reading yet another implementation calling it something else.