|
|
|
|
|
by goto11
1292 days ago
|
|
> Static typing gives a good baseline of correctness. Not really. Lets say you have an `add(a, b)` function. Static typing can guarantee that the function returns a number, but not that it returns the correct number. So you need unit tests anyway. A unit test `assert_equal(4, add(2, 2))` actually tells you something about the correctness about the function, and it implicitly also verifies that it returns a number. So static typing does not save you anything. Static typing does have advantages, for example for documentation and for automated refactoring. But it doesn't replace any unit tests. |
|