Magic Numbers

Magic numbers term refers to using numbers directly in your code. The assumption among some developers is that each number should have a variable name assigned to it. However, the general rule is that only unclear or repeating numbers should be assigned to a constant for readability and maintainability. There is a difference.

A good example would be the greatest number in the whole world – 3.14159265358979323846. You don’t want to use this number each time you need it in your code. Assigning it to a constant would be a much better solution. Your developer buddies will love you to death for doing that.

Continue reading “Magic Numbers”

Magic Numbers