3 ms·
I think this is a fault of language ergonomics rather than static typing. If you are gluing components together, then surely the components have a common inter
by wwright 6y ago
I think this is a fault of language ergonomics rather than static typing.
If you are gluing components together, then surely the components have a common interface that uses compatible types. And surely you need to tell the runtime what those types are in some way, even if that is simply by writing them to return appropriate values.
In theory, a statically typed language with ideal ergonomics would make that as easy to specify as a dynamic language, but would have the benefit of warning you of mistakes as early as possible.
Of course, many statically-typed languages trade-off some amount of ergonomics for other features.
- pizza234 6y ago> If you are gluing components together, then surely the components have a common interface that uses compatible types This is not guaranteed; for example, the representation of a JSON object is trivial in dynamically typed languages, because there are no type bounds. Ease of metaprogramming is another. Possibly also debugging - I don't get powerful REPLs in the statically typed languages I've used, as much as those in the the dynamically typed language I use. Concepts like these don't represent best practices for sure at large scale, but they do make things easier at least at small scale, and they don't need to be necessarily supported. Taken to the extreme, Perl variable autoinitialization and context sensitivity are very convenient for 3-statement programs, but they'd be horror above that. It doesn't make sense for any language to try to support that.
- fpoling 6y agoIn my experience when gluing things one needs at the very least dependent types to properly express relations. Without that the best hope is a good integration test, but with that in place static types for things that can be expressed in mainstream languages do not bring much extra value while contributing to the cost.