I was wondering if others find it unnecessary to do something like this ...
const double RESET_TIME = 0.0;
timeSinceWhatever = RESET_TIME;
rather than just doing
timeSinceWhatever = 0.0;
Do you find the first example for readability? The argument comes down to using magic numbers, and although 0 and 1 are considered “exceptions” to the rule, I always thought that these exceptions only apply to variable initialization or access to the index. When a number makes sense, it should have a variable associated with its value.
I am wondering if this assumption really is, or if it is just redundant to give 0 a named constant.
source
share