3 ms·
> Static typing does not protect you from bugs. But it does. It doesn't protect you from all bugs, but nobody claimed it did.
by the_af 11y ago
> Static typing does not protect you from bugs.
But it does. It doesn't protect you from all bugs, but nobody claimed it did.
- Skinney 11y agoTrue, should have specified what I meant. The thing is, static typing doesn't necessarily protect you from more bugs than a dynamic language. For instance, Clojure is less prone to NPEs because you don't call methods on objects, and because a lot of your program manipulates datastructures, and nil is treated as an empty datastructure. Of course, a language like Rust, which doesn't have null, does protect against NPEs. It's all relative.
- Skinney 11y agoReading this again make me realize that I'm wrong. Static typing will safeguard you against certain types of bugs that a dynamic language don't. The point I was trying to make was that a static language doesn't necessarily protect you against a certain type of bug, which you may rarely experience in a dynamic language.