←back to thread

Type checking is a symptom, not a solution

(programmingsimplicity.substack.com)
67 points mpweiher | 1 comments | | HN request time: 0.207s | source
1. xdennis ◴[] No.45143680[source]
> The standard answer is scale. “Small programs don’t need types,” the reasoning goes, “but large programs become unmaintainable without them.” This sounds reasonable until you realize what we’re actually admitting: that we’ve designed our systems to be inherently incomprehensible to human reasoning.

Reasoning has nothing to do with it. If I have a `scale(x, y, z)` function in my code I can easily remember how to call it.

But with a large codebase, if my fuzzy memory tells me I should call it as `scale([x, y, z])` I don't want to find out I'm wrong at runtime.

Unit tests are good, but there's a tendency for dynamic languages to overuse them exactly because they don't have basic type safety.