I recently had a conversation with someone and in passing I said something along the lines of singleton being a pointless design pattern and something that I’d try my best to not use. They said there were lots of reasons for a singleton, then we moved onto a different topic. However, it’s gotten me thinking, is there really a reason for the use of a singleton? I did some digging through StackOverflow and found a few reasons as to why to use one — but even then, it wasn’t a glowing endorsement. Nothing I’ve seen has really made me change my mind from the fact that the singleton pattern is something with very limited usability and most people seem to view the singleton pattern as a pox on the programming world.
Personally, I’d stay as far as way as possible from them unless absolutely necessary.
What do y’all think? Is it now an anti-pattern or is it something that is still useful?