4 ms·
How are you sure you haven’t introduced bugs if the specification/type has an error it doesn’t tell you about?
by agentultra 2y ago
How are you sure you haven’t introduced bugs if the specification/type has an error it doesn’t tell you about?
- auggierose 2y agoI have trouble parsing your sentence, to be honest. What are you asking? Are you asking how am I sure that/if my specification is correct? Are you asking how do I make sure I have no bugs without a proof? Maybe you are asking something else entirely?
- agentultra 2y agoBecause the type system is unsound, you could add an error to your implementation and the type system will not catch it. It will happily tell you that everything type checks. How do you use that to prevent errors?
- auggierose 2y agoYes, that can happen. Just as a sound type system will also not prevent all possible bugs. So what? TypeScript's type system helps me to prevent many bugs by performing standard sanity checks, and is a very practical tool. Just rephrase your question as "How will a pervasive system of sanity checks help me prevent errors?", and I hope you agree that it kind of answers itself.