|
|
|
|
|
by kraf
1259 days ago
|
|
Tests are great and the usual argument from static typing opponents is that they almost completely replace the regression safety from static typing. Types are not the same as tests at all, tests are much better at giving you a glimpse of what the code even does. For clarity, I'll define a static typing opponent as somebody who believes that the return on investment for static typing is negative. |
|
Types do that, they tell you the expected input and expected output. No type nor test is all-encompassing of course, but it gives at least some information.
No test will guarantee that a function will never return a number. Types, if valid and without prototypal shenanigans, can.