Of all the advice I’ve ever received, words I’ve received from my father are the most precious.
I’m super excited to announce that I’m using 10up’s newest product – PushUp – on this site. If you’re visiting on Safari you’ve already see the popup asking for permission to notify you.
When I ask developers, “why’d you use a Singleton here,” more often than not they reference a tutorial, another developer, or “that’s how I’ve always done it.” No one ever takes the time to learn about the patterns (or anti-patterns) they’re using so they can make informed decisions about software design.
There are valid reasons for using a Singleton in your design – these reasons, however, are rare enough that many developers can avoid them entirely and still have a full career. If you find yourself using Singletons often, you’re doing something wrong.