Cognitive load is what matters

January 7, 2025

Sometimes we feel confusion going through the code. Confusion costs time and money. Confusion is caused by high cognitive load. It’s not some fancy abstract concept, but rather a fundamental human constraint. It’s not imagined, it’s there and we can feel it.Since we spend far more time reading and understanding code than writing it, we should constantly ask ourselves whether we are embedding excessive cognitive load into our code.

Source: Cognitive load is what matters

I’ve written a lot of code in quite a few languages over 40 or more years.

I’m sure a lot of it is pretty bad.

But a tenet I’ve always tried to stick to is to make code relatively simple and readable and avoid tricks and cleverness.

Artem Zakirullin looks at how good code reduces cognitive load in understanding it.