Uncommunicative Name
Software is run by computers, but written and read by humans. Names provide important information to developers who are trying to understand a piece of code. Patterns and challenges when naming a method or class can also provide clues for refactoring.
Symptoms
- Difficulty understanding a method or class.
- Methods or classes with similar names but dissimilar functionality.
- Redundant names, such as names which include the type of object to which they refer.
Solutions
- Rename Method if a well-factored method isnât well-named.
- Extract Classâ if a class is doing too much to have a meaningful name.
- Extract Methodâ if a method is doing too much to have a meaningful name.
- Inline Class if a class is too abstract to have a meaningful name.