3 ms·
>Oh I know, but my opinion and experience in half a dozen statically typed languages over a decade is that most type systems add much more overhead to developme
by coldtea 10y ago
>Oh I know, but my opinion and experience in half a dozen statically typed languages over a decade is that most type systems add much more overhead to development than agility.
In what sense?
With type inference you don't have to manually specify them.
With a variant type, you don't have to confirm to a specific type, but can accept all, if you want it.
And you still need to conform to an interface in a dynamic language, if your function is x.indexOf(x) you still need to make sure to use it on two strings, if it's a math function on some numbers (and depending on the function, on a range), etc (1). So you are not even spared that -- instead, you just lose the help from the compiler when it comes to it.
(1) You could e.g. let a numeric type string autocoerce of course, but auto-coercion can also happen in static languages, is orthogonal to static vs dynamic typing, and is also generally to be avoided).