principles:principle_of_separate_understandability
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
principles:principle_of_separate_understandability [2013-08-10 10:59] – [Context] christian | principles:principle_of_separate_understandability [2013-10-07 10:21] – [Rationale] christian | ||
---|---|---|---|
Line 28: | Line 28: | ||
When a module is separately understandable, | When a module is separately understandable, | ||
- | Another point of view is that a violation | + | An important |
+ | * You have to find the implementation and jump there (modern IDEs help here but it takes time nevertheless) | ||
+ | * While doing so, you have to memorize the call and the context of the call. If implementation and call are not colocated (which is preferable but not always possible) you won't see the call anymore so you have to memorize it. | ||
+ | * Then you have to read the code and mentally inline it. | ||
+ | * If you could not memoroze everything, you might have to jump back and forth to do the job. | ||
+ | * After you did all that you have to jump back and continue reading the method with the call you just mentally inlined. | ||
+ | |||
+ | In a nutshell, if you have to mentally inline code, it would have been better if it was already inlined. The [[refactorings: | ||
+ | |||
+ | Another point of view is that a violation of PSU either means that a part of the functionality does not belong to that module or the module has the wrong abstraction. So this is a sign of a design that needs improvement. | ||
===== Strategies ===== | ===== Strategies ===== |
principles/principle_of_separate_understandability.txt · Last modified: 2021-10-18 22:13 by christian