Cognitive load is the mental effort needed to understand code, add a feature, or fix a bug. It matters because someone must still be able to read and change the code years after it was written. section 4.4 section 4.0
The source of that effort matters:
- Intrinsic load comes from the task itself. A complex banking domain remains complex even when its code is clear. section 4.4
- Extraneous load comes from how information is presented. An API that mixes levels of abstraction makes a task harder without helping solve the underlying problem. section 4.4
You cannot remove every difficulty, but you can avoid adding unnecessary ones. Working memory is limited: even reproducing a 20-line function, including its variable names, from memory is difficult. section 4.4
Reduce avoidable load where people encounter it:
- Make code easier to follow by reducing nesting, simplifying conditions, and keeping related behavior together. section 4.4
- Use abstractions when they add clear value; premature or inconsistent abstractions can make later work harder. section 4.4 section 4.3
- Keep README files, comments, and tests clear and current so they help people understand the system. section 4.4
interface Delivery {
public void deliver(DeliveryList items);
}
class DeliveryList {
private List coffees;
// Other items can be added as needed
}
The DeliveryList interface illustrates an abstraction around the product idea of delivery, rather than a separate method for every literal requirement. section 4.3
The concern extends beyond code reading. During an outage, pressure and cognitive load can make a sequence of events look causal or make an early hypothesis seem better supported than it is. Recognizing those traps calls for deliberate discipline. section 7.6







