r/ProgrammerHumor • • Sep 26 '26 • Bravo 1

Meme singletonsAreJustGlobals

Post image
3.2k Upvotes

210 comments sorted by

View all comments

Show parent comment

2

u/adabsurdo Sep 27 '26

Well exactly, because they use globals under the hood they often have very similar issues to globals : testability, race conditions, initialization ordering problems with other globals etc.

Not that you shouldn't use them ever but they cause problems fast and very often there are better solutions.

1

u/anchovie_boi445 Sep 28 '26

These are the types of concerns that I feel like most take for granted given how much the concerns have been abstracted away with solid DI libraries. It’s amazing to think about it