====== Mental Grouping ====== ===== Meaning 1 ===== ==== Alternative Terms ==== /*i.e. alternative names meaning the same thing*/ ==== 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 ==== /*i.e. slightly different definitions for basically the same thing*/ ==== See Also ==== * The contrary activity is [[mental inlining]] * [[principles:Single Level of Abstraction]] is about avoiding mental grouping ==== Further Reading ==== ---- ===== Other Meanings ===== /*i.e. the same term referring to something different; put short mentions here or better add more detailed descriptions as additional sections */ ---- ===== Discussion ===== Discuss this wiki article and the term on the corresponding [[talk:glossary:Mental Grouping|talk page]].