|
| ▲ | cyberax 18 hours ago | parent | next [-] |
| 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). |
| |
| ▲ | monkpit 15 hours ago | parent | next [-] | | 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. | |
| ▲ | markus_zhang 17 hours ago | parent | prev [-] | | This also helps downstream a lot. |
|
|
| ▲ | gleenn a day ago | parent | prev | next [-] |
| One of the Mars landers famously failed due to unit conversion errors from metric to standard. |
| |
| ▲ | blemasle a day ago | parent | next [-] | | 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) | | |
| ▲ | fc417fc802 a day ago | parent | next [-] | | Claiming something isn't standard because it isn't based on SI is entirely circular in the case of weights and measures. That said I wish the US would bite the bullet and make the switch. Mandating dual labeling on everything would be a great start. Then in 20 years we could narrow it back down to one. | | |
| ▲ | reddalo a day ago | parent [-] | | You just need to start teaching kids the metric system. Then when they'll grow up the switch will almost magically happen by itself. | | |
| ▲ | AlotOfReading 19 hours ago | parent [-] | | All of my science classes in the rural US from middle school onward were taught entirely in metric, and it had been that way for decades prior. Obviously I'm an adult now, and metric still isn't universal. |
|
| |
| ▲ | Dan_- a day ago | parent | prev [-] | | I know you’re being snarky, but the US system is not “imperial” anyway. It’s properly “US Customary” but is often called “US Standard.” |
| |
| ▲ | golem14 a day ago | parent | prev [-] | | Wasn't it (also?) the Ariane V flight in 1996? Oh, NVM, that was an overflow error. |
|
|
| ▲ | zapkyeskrill a day ago | parent | prev | next [-] |
| Degrees, very funny. |
|
| ▲ | 27183 a day ago | parent | prev [-] |
| It's not difficult to write regression tests that catch unit mistakes. |