Y
Hacker News
new
|
ask
|
show
|
jobs
by
lawl
2967 days ago
In this specific case DEBUGLEVEL should be a constant anyways, and thus assignment should fail, no? Also kind of denoted by being all caps.
2 comments
stan_rogers
2966 days ago
Conventions cause assumptions.
link
anyzen
2966 days ago
There are always assumptions being made, no matter what you do. But "uppercase -> constant" is such a generic and cross-platform convention that it should always be followed. This code should never have passed code review for this glitch alone.
link
onion2k
2966 days ago
Which language would stop/warn you assigning the value of a constant to a variable? Doesn't "var = const" just work in most languages?
link
eloff
2966 days ago
It's yoda condition, so const = var would fail.
link