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

Meme singletonsAreJustGlobals

Post image
3.2k Upvotes

210 comments sorted by

View all comments

Show parent comment

18

u/jaladreips271 Sep 26 '26

Wow, all these years and only this post gave me the enlightment. Noone ever pointed out to me that singletons can be scoped.

3

u/wobblyweasel Sep 26 '26

and the initialization is synchronized in the languages that natively support them

1

u/SamSlate Sep 27 '26

i still don't get it, isn't there always a scope?

2

u/jaladreips271 Sep 27 '26

I've never seen a singleton that didn't have a global scope. But frankly I don't see a lot of singletons in general.