|
|
|
|
|
by another2another
1228 days ago
|
|
>When the function was written, everyone probably knew what the adjustment factor was for and how it was determined, but years later,
>someone's going to look at that code and have no idea Well, to be fair that adjustment factor could be refactored to use a usefully named constant, with a helpful comment. static const int ZEN_ADJUSTMENT = 12345; //When I wrote this only myself and God knew what this value meant, now... int AddWithAdj(int a, int b) { return a + b + ZEND_ADJUSTMENT; } |
|