Re:Global variables are bad (2013)
by partycoder on Thursday July 26, 2018 @02:45AM
(#17615510)
Then those would be global constants not global variables.
[ Parent
| on HN ]
Conceptually yes, but some languages don't have distinct constructs for constants and just use variables (sometimes even mutable) for everything.
In many programming languages, "constants" are compile-time and therefore cannot be used for holding command-line parameter value.
Re:Global variables are bad (2013)
by partycoder on Thursday July 26, 2018 @10:42PM
(#17623081)
The only invariant of a constant is that it remains constant. The way that abstraction is represented is implementation specific.
Compiler generated constants can still change, because registers and memory are mutable.