Care and Feeding of Singletons
Programmer safety is, in my opinion, counterproductive. Apple’s approach, of building a singleton which can’t be destroyed by accident and which intercepts attempts to allocate a second instance, covers up errors rather than fixing them. It’s much better to trap and eliminate the bad code rather than render it harmless. For example, instead of overriding
release
to do nothing, overridedealloc
to log an error and abort the program.
Fail fast!