3 ms·
I'm a fan of the middle ground here where you limit magic numbers to known constants and arithmetic. This means some constants don't have magic numbers, but als
by hinkley 5y ago
I'm a fan of the middle ground here where you limit magic numbers to known constants and arithmetic. This means some constants don't have magic numbers, but also some inline uses don't necessarily have constants.
For instance 7, 24, 60, 1000 allowed in defining units of time, and any other intervals are defined as 5 minutes = 5 x 60 x 1000.
Still, I've had plenty of experiences with 'is this unit in seconds or milliseconds'. As I recall, Gilad Bracha at one point looked at attaching units to numbers but I think he got wrapped around the axle on automatic conversions - if you divide meters by seconds, this is a meters/second unit. But do you convert to newtons or joules automatically too?
- ttymck 5y ago60 minutes or 60 seconds?