Knowledge
Search knowledge... ⌘K
Knowledge · Anti-Patterns
Smell Long Method
Anti-pattern indicating need for refactoring
Tags
refactoring-fowlercode-smellmaintainability
Impact
The longer a procedure is, the more difficult it is to understand. Short methods named to show their intention lead to clearer and easier to read code. The key is the semantic distance between what the method does and how it does it.
Symptoms
- Method is too long to understand easily
- Need comments to explain what blocks of code do
- Lots of parameters and temporary variables
- Complex conditional logic and loops
Source
Martin Fowler — Refactoring: Improving the Design of Existing Code, 1st Edition (1999)