“There's a salient point in that talk where he describes a mission that failed due to a human error.”
Stroustrup on unit-conversion bugs and using types to prevent them
Full comment
This sounds like the kind of problem that puts really expensive robots into craters. this video There's a salient point in that talk where he describes a mission that failed due to a human error. Someone forgot to convert an internal representation of a unit in some algorithm which led to a miscalculation and a loss of some millions of dollars. Apparently the error made it through all of the code reviews and tests that were written. Bjarne then shows some pretty simple code that might have avoided such a disaster by specifying your types up front and letting the compiler do the work of converting them. Seems like a pretty simple concept and I wonder why it's so often missed.
