4 ms·
Don't you just need to to actually use/test your code? Don't you need to do this in a statically typed language as well?
by preordained 9y ago
Don't you just need to to actually use/test your code? Don't you need to do this in a statically typed language as well?
- lmm 9y agoOften you don't. When you're really leveraging the type system, if it compiles it'll be correct. You might need to test the actual business logic, but realistically that ends up being a small proportion of the code you write. People don't like talking about how type systems let you write fewer tests, perhaps because it makes them sound like cowboy coders, but honestly it's a huge advantage.
- Can_Not 9y agoNot only can you write more precise tests (because you don't have to worry about run time crashes from type errors or logic errors from type mismatches) but your tests themselves are also type checked.