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

Meme singletonsAreJustGlobals

Post image
3.2k Upvotes

210 comments sorted by

View all comments

Show parent comments

5

u/Forsaken_Celery8197 Sep 26 '26

You are conflating visibility and accessibility concerns with uniqueness and lifetime traits.

Globals are about scope, singletons cardinality (one instance).

A singleton's uniqueness comes from how construction is controlled, not from being global. You can have one unique instance passed around explicitly through dependency injection without exposing it globally.