3 ms·
I spent quite a few years living in dynamic languages and looking enviously over the wall at those lucky engineers who could use static type systems to catch al
by lbayes 5y ago
I spent quite a few years living in dynamic languages and looking enviously over the wall at those lucky engineers who could use static type systems to catch all their bugs (truly, this is not sarcasm).
Then I finally got an opportunity to work in a handful of those environments, of course the first was everyone's favorite whipping boy, Java.
Yikes!
Maybe I've just been unlucky or unsmart, but wow, I've seen (and even made) some really impressive messes with these languages (specifically: Java, ActionScript 3.0, Closure (.js), Typescript, Go, C++ and C).
In my experience, especially in the context of UI development, the static type systems I've encountered generally make the task of unit testing more difficult and time consuming, while adding little to reliability.
At the end of the day, I just don't bump into major type mismatches in dynamic languages that cause a whole lot of hearteache.
All that said, Go was probably the best static type system I've worked with until I (recently) discovered Zig, which has a really interesting type system (esp. related to comptime) and has testing built into the language itself.
While it might at first look like it, I'm not saying static type systems don't have a home in my heart.
I'm just saying that in my experience (just like TDD and Unit Testing), they haven't led to the bug-free panacea that proponents tend to imply.
I do find it endlessly fascinating that 2 people can walk through similar-ish challenges and arrive at entirely opposite conclusions about how to best tackle them. Thanks!