-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Labels
Description
It's generally advised to avoid hardcoded numbers in functions. Functions shouldn't have magic numbers inside it. It makes harder to maintain the code and also decreases readability. Imagine if you use a magic number, let's say 350 ten times in your code. One day you decide to change it from 350 to 360. What do you do? You search all occurrences in the code and change them. If you have this value extracted, you can change it only in one place to achieve the same effect.
For example, consider refactoring calculateBonus() function.
@pauliax
ETH address: 0xaAbf60384137D460427fD5B849017e59479797A1
Reactions are currently unavailable