Hacker News new | past | comments | ask | show | jobs | submit login

And from that document:

  Third, avoid using a lazily-initialized Singleton unless
  you really need it. The classic Singleton implementation 
  is based on not initializing a resource until that
  resource is requested. An alternative is to use eager 
  initialization instead, i.e., to initialize a resource at 
  the beginning of the program run.
I've personally never found the need for a lazy-loaded singleton and I expect the same to be true for most other software developers. This whole problem stems from the premature optimization of thinking lazy-loading something would be nifty.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: