Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The Singleton pattern can be used to fix the order of static constructors. I think that this is the only reasonable use for the singleton pattern (which is just a global variable in disguise).

In my opinion, it's better to not rely on static constructors for anything non-trivial (singleton or not). They can be such a pain in the ass to debug.



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

Search: