3 ms·
What I mean is, a while ago you were hearing a lot of ra-ra stuff about how great dynamic languages were because static typing was just a waste of time that mad
by emodendroket 7y ago
What I mean is, a while ago you were hearing a lot of ra-ra stuff about how great dynamic languages were because static typing was just a waste of time that made you less productive. And then sooner or later all those languages evolve a documentation system with types in it, and then type hints, and so on, as it becomes clear that those earlier claims weren't true for long-lived projects.
- dragonwriter 7y agoYou see the same in reverse with many industrially popular statically typed languages gaining dynamic escape hatches, such that optional static typing, from one end or the other, is pretty much the uniform rule for industrially popular languages.
- emodendroket 7y agoThat is true, but as I see it the use of the dynamic features in statically typed languages tends to be much more limited, with most preferring it as an absolute last resort.
- joshuamorton 7y agoReally? I feel like stuff like DI frameworks are super common in Java, and they're essentially dynamic magic.
- emodendroket 7y agoI'm more familiar with C#, so there may be differences, but while the DI containers do do a lot of dynamic work, it is carefully abstracted so that all code the user writes to interact with the container is type-safe. It's very rare for methods in these languages to return object or dynamic, and slightly less rare but still far from common for these to be arguments. Isn't enabling this style exactly why generic support was such a big deal?
- joshuamorton 7y ago> I'm more familiar with C#, so there may be differences, but while the DI containers do do a lot of dynamic work, it is carefully abstracted so that all code the user writes to interact with the container is type-safe. It's very rare for methods in these languages to return object or dynamic, and slightly less rare but still far from common for these to be arguments. Sure, but this is true with (most) weird dynamic code in dynamic languages too. Just look at something like `attrs`. Its letting you dynamically construct classes, but you can do so in a type safe way.
- emodendroket 7y agoThe static typing I care most about is function signatures, because it 1) helps my IDE catch me invoking things in unintended ways 2) lets me figure out how to use a function without reading it. Inside the body of a method, go nuts, I don't care. But whenever I'm dealing with a long-lived project I find signatures are a big help.