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

Conventions cause assumptions.
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.
Which language would stop/warn you assigning the value of a constant to a variable? Doesn't "var = const" just work in most languages?
It's yoda condition, so const = var would fail.