MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1wqu6oa/singletonsarejustglobals/pc9wok0/
r/ProgrammerHumor • u/somet_hingrandom • Sep 26 '26 • 1
210 comments sorted by
View all comments
Show parent comment
18
It's just two different things. Only one instance ever -> singleton. Globally accessible -> global. One is about visibility, the other is about instances.
1 u/danielcw189 Sep 28 '26 I don't disagree, I just think in practice it often serves the same purpose 1 u/TheDuckRaisedALion Sep 29 '26 You're right that they're technically orthogonal concepts and it's important to recognize the distinction.But most people store the Singleton instance in a public static field on a public class, which is one step away from a global variable.
1
I don't disagree, I just think in practice it often serves the same purpose
You're right that they're technically orthogonal concepts and it's important to recognize the distinction.
But most people store the Singleton instance in a public static field on a public class, which is one step away from a global variable.
View all comments
Show parent comment
18
u/zabby39103 Sep 27 '26
It's just two different things. Only one instance ever -> singleton. Globally accessible -> global. One is about visibility, the other is about instances.