5 ms·
Static typing makes refactoring easier. Your compiler can instantly tell you what you've broken. Bugs are reduced by monitoring, testing, and reducing how muc
by agildehaus 4y ago
Static typing makes refactoring easier. Your compiler can instantly tell you what you've broken.
Bugs are reduced by monitoring, testing, and reducing how much code there is so there's less surface area (which also makes monitoring and testing easier).
You reduce code by refactoring.
- strager 4y ago> Your compiler can instantly tell you what you've broken. For some definition of "instant". I can often run my Python or JavaScript test suite faster than Haskell/GHC or Rust/rustc can type-check a module. And it can take a while to understand Haskell, Rust, or C++ error reports. (Of course, Python and JavaScript startup time and execution speed can hurt refactoring too. And AttributeError-s and random undefined-s aren't always easy to debug.)
- elteto 4y agoGot it, you can be wrong faster!
- wtetzner 4y agoI doubt you can run your Python or JavaScript test suit faster than the OCaml compiler could both typecheck and compile your code.
- ReactiveJelly 4y agoHow many hours do you, the human, have to spend maintaining the type-checking of that test suite?
- strager 4y ago> Bugs are reduced by monitoring, testing, and reducing how much code there is so there's less surface area (which also makes monitoring and testing easier). > > You reduce code by refactoring. This is a great point. I wonder if there's a study on bugs-per-line-of-code, how this changes across project sizes, and whether refactoring changes bugs-per-line-of-code.