4 ms·
What’s wrong with using the metric system?
by shwoopdiwoop 2y ago
What’s wrong with using the metric system?
- Swizec 2y agoIs a reference to this famous incident of a mars lander slamming into mars due to mismatched units. https://everydayastronaut.com/mars-climate-orbiter/ https://everydayastronaut.com/mars-climate-orbiter/
- kanbankaren 2y agoNot sure whether they used a value pattern. typedef struct { float value; } meter; typedef struct { float value; } feet; Using strong typing, you can avoid passing values in wrong units.
- einpoklum 2y agoIn C++, there are a few very nice libraries for computation with units, e.g.: https://github.com/mpusz/mp-units https://github.com/mpusz/mp-units which does all sorts of checking, allows arithmetic with proper accounting for units and so on. But yes, the basic notion is wrapping things in structs which can't be simply assigned to each other.
- dgoodell 2y agoThe mars probe unit problem was mismatched between different software programs. One was telemetry reported by the spacecraft to the ground, the other was software on the ground that used this telemetry to perform calculations that reported the results with the incorrect units. Maybe the answer is that strong typing should somehow continue outside of the individual programs and be embedded in file formats as well?
- kanbankaren 2y agoYes. Any message exchanges should have type encoded like in ASN.1, but not sure whether NASA used such a format.
- naturlich0 2y agoNothing lol but people tend to be obnoxious about using it
- marcosdumay 2y agoNASA often forget they use it.