Hacker News new | ask | show | jobs
by mleonhard 1466 days ago
Most of the cost of systems comes from maintenance. Most maintenance effort is spent reading code and trying to understand it. Types are documentation that speed up reading and comprehending. They're documentation that cannot get out of date because they compiler checks them. Don't think of type signatures as boilerplate or extra verbosity. Think of them as electromagnets waiting to accelerate future you.

Professionally, over about 12 years, I have used Java, C++, Golang, Rust, Dart, Python, Perl, and Swift. Since learning Rust, every other type system seems slightly broken. Fixing a red-underline takes a few seconds. Debugging runtime errors takes 10-times as long. And debugging runtime errors in a long CI run can take 100-times as long. Because static types let us catch errors earlier, they speed up writing and changing code.