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

I've seen so many singletons that just exist because java lacks conditional compilation, and you need either a test-something or a real-something.

Of course I've also seen heaps of singletons that exist for no reason and could just have been a static class, sometimes because of cargo cult, sometimes because "what if we want to make it configurable later?"

Such a waste of energy



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: