Hacker News new | ask | show | jobs
by dhosek 2130 days ago
Never, ever, "help" the compiler.
1 comments

Counterargument that you should focus on letting the compiler help you which is just a redirected way of "helping" the compiler.

Types are a really good example of where you want to help the compiler. Type signatures let you define how the type can be used. By adding as much information about how the type should be constrained, you can help the compiler prevent you or someone else from doing something stupid and on occasion, you can earn some optimisations in the process.