Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Quite an assertion to say that static typing slows people down. I find the opposite. Beyond a few hundred lines you get a ton of productivity benefits that easily outweigh the time it takes to write types down:

1. Shorter iteration time for fixing type errors, especially things like field typos, missing arguments etc. They show up immediately as I'm typing instead of having to run a test suite (and having to write an extensive test suite).

2. You can write fewer tests to achieve the same code quality. Especially with really strong type systems like Haskell and Rust. Huge time saver.

3. IDE navigation features (go-to-definition, find-all-references) are generally faster and more reliable than grepping. I'm sure we've all had the pain of trying to grep where the `process` function is defined in a large dynamically typed codebase.

4. Auto complete works reliably.

5. You can refactor things reliably, especially renaming identifiers.

6. For multi-person projects or long-lived single-person projects it means you waste less time figuring out what code does.

IMO gradual typing isn't a good idea. Adding types after the fact is much more effort because you basically have to reverse engineer the code. And you don't get the performance benefits of "true" static types. There's a reason Dart switched away from it.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: