3 ms·
There are three main ways to reduce errors in code: tests, asserts and abstractions. All three have advantages and disadvantages and generally deal with differe
by js8 8y ago
There are three main ways to reduce errors in code: tests, asserts and abstractions. All three have advantages and disadvantages and generally deal with different classes of errors.
In this thread, we discuss asserts, not abstractions. Monad is an abstraction. (On the other hand, many people only see tests and forget about two other solutions, which are as important.)
- pmichalina 8y agoTests are good of course, but that assumes the tests are valid. I’d rather trust compiler to ensure runtime safety.