Software Design/Cognitive load
Cognitive load is defined by John Ousterhout in A Philosophy of Software Design as a symptom of complexity which refers to how much a developer needs to know in order to complete a task.[1]
In a more general sense used in the Software Design project, cognitive load is the effect of a developer expending more mental efforts while working on a codebase (and, by extension, on individual tasks), either because they need to
- Learn a lot of details
- Manipulate many intertwined objects or concepts in their minds (which requires disproportionally more mental energy than keeping in mind the same number of independent objects)
- Sustain their focus on the tasks at hand in the face of distractions imposed by the workflow (which may be in part determined by the code itself, e. g. see quality How much navigation is needed while working with code) or by the code itself, e. g. inconsistent style
- Etc.
As a high-level code, interface, or software quality, cognitive load may be defined as the expected amount of cognitive load which will be imposed on developers of the code or the users of the interface or the software during their work with the corresponding code, interface, or software.
Relations to qualities
editSteepness of learning curve contributes to cognitive load: these qualities are both proxies of the amount of information that developers or readers need to learn in order to work with or just understand the code.
Relevant practices
edit- Link to a ticket from an unusual place in code
- Object access chains: both hiding and exposing them may reduce the cognitive load of working with the code, depending on the context.
See also
editOther symptoms of complexity, according to A Philosophy of Software Design:
References
edit- ↑ Ousterhout, John (2018). A Philosophy of Software Design. ISBN 978-1732102200. Chapter 2.2 "Symptoms of complexity"