Table of Contents
Mental Grouping
Meaning 1
Alternative Terms
Definition
Mental grouping is an activity which is sometimes necessary in order to understand code. You do it when you try to find out what a group of statements does.
Description
If you read code several statements may belong together and have a combined purpose. If these lines aren't already grouped syntactically by having a method with a fitting name, the reader of the code will inevitably create this missing abstraction while reading the code. This is necessary for understanding.
On the other hand the necessity to do mental grouping is a deficiency of the code. If the grouping would manifest as a syntactic structure like a method, the code would be easier to understand.
The same holds for bigger structures, so any concept which is needed for understanding but not physically represented as a variable, a method, a class, a package, etc. requires the reader to do mental grouping each time the code is read.
Examples
Alternative Definitions
See Also
- The contrary activity is mental inlining
- Single Level of Abstraction is about avoiding mental grouping
Further Reading
Other Meanings
Discussion
Discuss this wiki article and the term on the corresponding talk page.