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

I'd heavily argue against "stuff just works". Without type annotations it's this wild west where stuff fails in prod because you don't have tests that cover every possible code path. With static type analysis, you're able get automatic test coverage for a huge swath of your codebase.

I can't count the number of times I've seen None-related errors in prod because some function deep in the business logic can't handle a None parameter.

Another huge benefit of type annotations is that it adds friction for clever code. As I've retroactively added type annotations to old code, I've discovered wild polymorphism. Some functions required upwards of 10 type signature overloads to account for all the polymorphism -- engineers have to remember all that polymorphism! Engineers won't write extremely polymorphic functions if they also have to write the convoluted overloads.



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

Search: