DIGNALEGI

The reading room · Digna Legi

Type inference has usability problems (2019)

A personal relevance score

80–100: high value. 70–79: worth the time. Below 70: below the usual publication threshold.

Evidence-reviewed score based on available publisher text. The author builds a strong argument, but the supplied text presents a research agenda rather than empirical study results.

Scores reflect one reader’s profile, not an objective quality rating. Best is a separate personal selection.

How scoring works →

This brief · about 2 min with detail

Original article ↗

Why read this

Henley argues type inference can shorten code while making readers reconstruct, remember, hover, or navigate elsewhere for hidden type information.

AI brief · Checked against source text

The main idea

Henley argues that type inference is treated as an obvious improvement without enough evidence that it helps programmers. Its apparent cleanliness can hide a comprehension cost: readers may have to infer, remember, hover, or navigate elsewhere to recover type information, and those small interruptions can add cognitive load when code already demands attention.

Some background helpful. Basic familiarity with variables, types, and reading code.

Go a little deeper

Tool support is not free

Hover tooltips and jump-to-definition reduce the pain of hidden types, but Henley’s point is that they change the reading task. The reader must interrupt local comprehension, query the environment, remember the answer, and resume. That cost is worse outside a rich editor, such as code review on GitHub, where the hidden information may simply be unavailable.

Readability depends on recoverability

The examples separate easy inference from risky inference. Literals and direct constructors are straightforward; well-named functions may permit a guess; chained calls and generic wrappers can surprise the reader. The mechanism is not that inferred types are always obscure, but that the reader’s confidence varies with how directly the expression exposes the relevant type.

Brevity can be the wrong optimization

Henley treats the argument from typing speed as especially weak because writing code is rarely bottlenecked by keystrokes. He is more hostile to the generic-verbosity defense: when explicit types become grotesque, his preferred answer is not necessarily inference, but refactoring the code producing that shape.

How the case is made

The case is made through production-code examples, tool behavior, documentation changes, and a cognitive-load analogy.

Where the idea has limits

The argument does not reject every inferred type; it targets unexamined default adoption, especially where the type is not obvious from the expression or surrounding names.

A question to take away · from Digna Legi

Where does your codebase save keystrokes by making future readers reconstruct facts the writer already knew?

What the original adds

The source includes concrete C#/Go-style snippets, a surprising production example whose inferred type violated expectation, and references to Go linting and Visual Studio/MSDN guidance moving toward explicit types in some cases.

About this brief

AI-written, then separately checked for source support, useful detail and clarity. The author’s claims and our editorial question are kept separate. The original remains the author’s work. How we select and summarise →

Digna legi. Worth reading.