News for hackers. Stuff that matters.
Re:What is a magic number, and why is it bad? by praptak on Wednesday August 28, 2013 @11:28AM (#6290571)
Agreed. All of the top 3 answers focus on the numbers being directly used in code which is not the real reason why magic numbers cause problems.

They are bad because of not being explained. A number directly used in code is not magic if it is properly commented. Granted, explaining it by making it a named constant is very often better (reusability), but a literal number that is merely commented is not "magic".

There are no comments on this comment yet.