2 ms·
This is interesting. But be aware that singletons are to be regarded cautiously for all of the reasons that, say, global variables are.
by btilly 14y ago
This is interesting.
But be aware that singletons are to be regarded cautiously for all of the reasons that, say, global variables are.
- klodolph 14y agoPlus some additional reasons: if a singleton is initialized on first use, it might be hard to reason about which kind of environment exists when it is initialized -- what locks are held, etc.