←back to thread

Type checking is a symptom, not a solution

(programmingsimplicity.substack.com)
67 points mpweiher | 1 comments | | HN request time: 0s | source
Show context
crazygringo ◴[] No.45142085[source]
> Why do we need type checking at all? The standard answer is scale. “Small programs don’t need types,” the reasoning goes, “but large programs become unmaintainable without them.”

No it's not.

Type checking is a first line of defense against bugs. That's all.

It's just making sure you're not accidentally passing invalid data or performing an invalid operation.

And since the article gets the premise wrong, its conclusion that reducing complexity will make type checking "largely irrelevant" is therefore also wrong.

replies(3): >>45142327 #>>45142430 #>>45145286 #
1. jameson ◴[] No.45142430[source]
Right. Also same rationale goes to compile time vs runtime time checks -- catching type bugs before the program is executed