4 ms·
I don't understand the link's final remark: > This doesn't mean that languages shouldn't include more complex type systems, but it does (or should) mean that t
by p4wnc6 10y ago
I don't understand the link's final remark:
> This doesn't mean that languages shouldn't include more complex type systems, but it does (or should) mean that the onus is on their designers to show that the complexity is worthwhile.
In general, the "complexity" of more advanced type systems is not presented to the programmer, with C++ being a notable exception.
Instead, the programmer benefits from ease of expression of types even when they are mostly writing monomorphic functions. For example, I would say that > 95% of the benefit I've ever derived from Haskell's static typing system has been due to the clarity of type expression and the codification of intentions in monomorphic functions! All the extra stuff with advanced type class features, higher order types, quantified types, etc., is nice and all, but it probably has only ever mattered to me for at most 5% of the cases.
Regardless though, in those other 95% of monomorphic cases, the clarity of the static type system, the way it has made me clarify my design and think about the type constraints in function call chains, the way it has made me codify my intentions for other developers to see, the way it has prevented silly bugs or highlighted misconceptions I wouldn't have otherwise caught -- this has all been very valuable, all without me ever having to really deal with any "complexity" of the Haskell type system. As a mere Haskell user, I don't have to fiddle with that. The existence of the fancier type options never gets in my way if I don't need it for anything.
Now, I love Python and I'm not saying static typing is always better. I'm just saying that if a language has a fancy and "complex" type system, that's not the same thing as saying that a day-to-day programmer will ever have to interact with that complexity in order to get benefits from it. They probably won't. They'll get lots of valuable benefits more or less for free even (perhaps especially) when their programs are mostly monomorphic.