logoalt Hacker News

skydhash • today at 12:03 PM • 0 replies • view on HN

> Your tests become limited to things that are hard or impossible to assert with the type system

Type systems are not a panacea. You still have to be logical and careful about them, especially around boundaries where types are just assumptions and not logical inferences. Then you have functions that switch type, but only a subset of the input is actually valid (string -> int for a number parser). Checking for NaN is like checking for Null.

Type systems does help, but they need the same attention as code to be actually helpful.