Hacker News new | past | comments | ask | show | jobs | submit login

This approach to typing could have saved the Mars Climate Orbiter, i.e a pounds of force type vs. a newtons type.

> "A NASA review board found that the problem was in the software controlling the orbiter's thrusters. The software calculated the force the thrusters needed to exert in pounds of force. A separate piece of software took in the data assuming it was in the metric unit: newtons.... Propulsion engineers, like those at Lockheed Martin who built the craft, typically express force in pounds, but it was standard practice to convert to newtons for space missions. One pound of force is about 4.45 newtons. Engineers at NASA's Jet Propulsion Lab assumed the conversion had been made, and didn't check."

https://www.wired.com/2010/11/1110mars-climate-observer-repo...

There could be issues with memory use, but it could also be implemented as an API, i.e. ensuring values exported from one software package to another were of the correct type, but then store them internally as simple types... Switching everything to a unified metric system would make more sense in the long run, however.




More like an i18n or l10n issue than types.


I think you've inadvertently stumbled on another great example, distinct types for TranslatedMessage, LocalizedNumber, etc. from ordinary string has been a cornerstone of localization enforcement on at least two large applications I've worked on.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: