logoalt Hacker News

superjantoday at 5:16 AM4 repliesview on HN

About the use of different units: next time you choose a property name in a config file, include the unit in the name. So not “timeout” but “timeoutMinutes”.


Replies

s1mntoday at 2:38 PM

Yes!! This goes for any time you declare a time interval variable. The number of times I've seen code changes with a comment like "Turns out the delay arg to function foo is in milliseconds, not seconds".

layer8today at 6:33 AM

Or require the value to specify a unit.

show 1 reply
weird-eye-issuetoday at 5:48 AM

timeoutMs is shorter ;)

You guys can't appreciate a bad joke

show 3 replies