by kummappp · 6y ago · 0 comments
I would use typed API's though, because it saves documentation reading time and makes the editor autocomplete to work like magic.
This is not true. Unit tests cannot replace a type system, just like a type system cannot replace unit tests.
You need a unit tests because a type system cannot check for all possible types of correctness.
However, unit tests can only check for the presence of bugs; they cannot prove their absence. On the other hand, a type system can prove that certain classes of errors cannot exist in the program.