4 ms·
Explicitly saying "I want 10 years" is different than saying "a large number. Do the math to know more". This is how identifiers can help understanding the prog
by partycoder 10y ago
Explicitly saying "I want 10 years" is different than saying "a large number. Do the math to know more". This is how identifiers can help understanding the programmer intention.
Then, you can define the time length as an arithmetic operation. Such as 10 * (60 * 60 * 24) * 365.
These might be still considered magic numbers to certain extent, but it's simpler to recognize numbers such as 60, 24 and 365.