2 ms·
There's two sides to it: First, there's only so much I can hold in my brain at once. If the computer can do some of the tedious busy work, let it. Second, t
by eru 6y ago
There's two sides to it:
First, there's only so much I can hold in my brain at once.
If the computer can do some of the tedious busy work, let it.
Second, the first perspective talks about catching errors and oversights. A sufficiently non-bad programmer could make do without. But static typing also allows for some programming techniques that wouldn't work without.
As a silly example, Haskell makes heavy use of overloading-by-return-type. You just don't the information about what return-type is expected available dynamically, it needs to be static.
There's also lots of optimizations that are safe only when the compiler knows more about your code. (Of course, a sufficiently non-bad programmer could write directly in the machine language of every processor she's writing code for..)
In practice, typing helps me a lot with eg exhaustiveness checking for my pattern matches.
The type system that dialyzer exposes is pretty weak. So not a good standard to measure all of typing against.