← Back to context

Comment by pudgywalsh

6 days ago

"I must've put a decimal point in the wrong place or something. I always mess up some mundane detail."

Unit mistakes happen all the time, which is why you should be using your units library religiously and still being vigilant even then.

Worst case I've found was off by 15 orders of magnitude.

  • One of my personal rules is to ALWAYS suffix the variables and fields with unit names:

    `timeout_ms` or `rate_kbps`, NOT `timeout` or `rate`.

    Unless the variable type already constrains it (e.g. Duration in Go).

    • Until someone comes along and changes it without updating the name, or the value comes from a remote service and they change without you changing your name… etc.

  • It's not difficult to write regression tests that catch unit mistakes.

  • One of the Mars landers famously failed due to unit conversion errors from metric to standard.

    • I didn't know the imperial system was named "standard". Funny, cause its everything but standard both internationally and its definitions (which are not standard as based on SI)

      5 replies →

    • Wasn't it (also?) the Ariane V flight in 1996? Oh, NVM, that was an overflow error.

Multiple rockets exploded and space missions failed because of the imperial vs. metric BS, and those mistakes were made by people all with PhDs or equivalences. This is still pretty mild in comparison haha.

Units and datetime will always be the bane of any professions ...