JincorTech / ico

Jincor ICO smart-contracts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hardcoded numbers

hlogeon opened this issue · comments

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