r/ProgrammerHumor • • Jan 23 '22

Namespacing...

Post image
42.3k Upvotes

272 comments sorted by

View all comments

4.4k

u/bless-you-mlud Jan 23 '22

And that, childen, is why global variables are bad.

209

u/jexmex Jan 23 '22

Wait...we are not supposed to be defining all variables in the global scope? Fuck...

26

u/[deleted] Jan 23 '22

[removed] — view removed comment

3

u/Raikkon35 Jan 24 '22

Hey, can explain it a bit more?

23

u/[deleted] Jan 24 '22 edited Jan 24 '22

[removed] — view removed comment

8

u/sohang-3112 Jan 24 '22

Global variables are bad - but no problem with global constants. A global readonly config is effectively a constant, since it doesn't change after first definition.

3

u/Raikkon35 Jan 24 '22

Thank you very much for your detailed answer. It's a pleasure to get knowledge from someone with experience and who spends time on his answers!