Types are documentation

Types are documentation

Comments go stale; types fail the build. On a recent project I deleted most of our doc comments and moved the same knowledge into the type system: narrower unions, branded IDs, and functions that can’t be called wrong. What worked, what got too clever, and where I drew the line.