|
|
|
|
|
by jemfinch
4126 days ago
|
|
Singletons were perhaps the worst possible example of code snobbery: code snobs (real code snobs, as in "no true code snob") typically detest the singleton pattern as less maintainable, less testable, and less flexible than dependency injection. |
|
However sometimes a singleton is in fact more maintainable and improves the code massively. Nor do they have to be less testable when implemented well.
None of which detracts from the article which is about consistency in the code base. A knew jerk reaction to the singleton completely misses the point.