3 ms·
Singletons are Pathological Liars (2008)
- MatthewPhillips 16y agoI'm not one to defend singletons (been burned by them myself), but this is a pretty poor example of why they suck. Any singleton that requires an outside .init() call is a pretty poor singleton. The whole point vs. globals is that they are lazy loaded. Why not: getInstance() { if(_instance == null) { init(); } return _instance; }