by Gratsby · 10y ago · 0 comments
Phase 2: OK, but those bugs are my own programmer errors.
Phase 3: I admit it, I have no idea what I'm doing.
Phase 4: OK, I can't even figure out what the Haskell I did two years ago was even trying to do. I was smarter then.
1) They passed unit tests. 2) They passed a type checker.
If a bug did not cause a unit test to fail, then it passed the unit test suite. (Less cryptically, an empty set is still a set)
The type-checker prevents certain classes of bugs, inconsistencies in types, lots of silly typos and mistakes. But it doesn't fix errors in our logic or algorithms. The type-checker doesn't know you should have added instead of multiplied, nor does it fix conversion errors at the borders of our programs where we, say, write a Haskell data structure into a JSON file.
Dimensional analysis is a type system that knows exactly that.
Similarly, not all diseases are prevented by vaccination, but that's not considered a good argument to stop vaccinating people against those diseases that are prevented by vaccination.