HACKER Q&A
📣 amichail

Is it rational to prefer certain constants over others when programming?


For example, why prefer 100 over 137?


  👤 gostsamo Accepted Answer ✓
Mainly, because it can help with stuff like mental processing from developers, better management, and sometimes easier life for accountants. 137 as an odd and even prime number is hard to divide. Lots more, if you can use certain subset of all numbers, you don't have to remember that many different cases.

👤 quickthrower2
I think if I said Thread.Sleep(1388) - this will slow the reading programmer down as they will think "why 1388, is this to avoid a race condition" and distract them from whatever they are trying to do.