▲ | motorest 4 days ago | |
> Type checking is a first line of defense against bugs. That's all. Exactly, and it goes way beyond that point. Static type checking turns expensive, hard-to-catch bugs that manifest only at runtime when exercising specific code paths into cheap, trivial to spot bugs that you spot at compile time. On top of that, nowadays it greatly improved developer experience as IDEs use type hints to detect and avoid bugs even before you compile the code, and even helps autocomplete code you are typing. We've been through this before. Haven't we learned this yet? | ||
▲ | adamddev1 4 days ago | parent [-] | |
One of the things that drives me crazy is when people say with such brazen confidence, "we don't need type checking because our tests catch type errors." But even if your tests do catch a large amount of the errors (depending on how thorough your tests are that you've written), YOU STILL HAVE TO GO HUNT DOWN WHERE THAT ERROR CAME FROM when a test fails. Isn't it so much nicer to just have the type checker automatically show you exactly where the type error came from? |