3 ms·
Unless you are using Haskell or Rust then static typing is a terrible way to check if your program is correct. You need unit tests to confirm the correctness o
by ReflectedImage 4y ago
Unless you are using Haskell or Rust then static typing is a terrible way to check if your program is correct.
You need unit tests to confirm the correctness of your program. And unit tests check most of the types for free. So you don't need static typing after all.
- kaashif 4y agoThe person you're replying to didn't mention this, but I find the main utility of static typing to be that all variables and functions either have explicit types or their types can be inferred by the IDE. Great for readability when I'm wondering what type this parameter is supposed to be and what I can do with it. You can obviously have documentation of types without static types, but static typing means you have ever-present compiler-verified documentation of types. Not always enough, but it's a lot more helpful than just having nothing. Having exhaustive unit tests doesn't necessarily help with this.
- ReflectedImage 4y agoMost types can be inferred via your IDE, you generally get what you are talking about anyway for free.