By Jeff Nuss
Magic numbers are an anti-pattern and should generally be avoided. What do I mean when I say magic number? I’m referring to using numbers directly in code as opposed to using a named constant. This can also apply to other data types and literals, especially strings. Why are they bad? They inhibit readability and refactorability.