3 ms·
When reading the title, the first thing that struck me too was division by zero. I doubt this is a common misunderstanding among any but the most junior of dev
by ErikBjare 2y ago
When reading the title, the first thing that struck me too was division by zero.
I doubt this is a common misunderstanding among any but the most junior of devs.
- kkapelon 2y agoI chose divide-by-zero because it is super easy for everybody to understand. But that is not important. In a real application it might be a unicode error, a date error, a wrong-format error or something else.
- ErikBjare 2y agoIn a language with errors as values, 100% code coverage (and no `unwrap()`) would force you to handle all the types of errors you mention.