Code Smell 38 - Abstract Names
Maxi Contieri
Posted on November 30, 2020
Avoid too abstract names. Names should have real world meaning
Problems
Solutions
Choose meaningful names.
Find metaphors.
Avoid words like abstract, base, generic, helper etc.
Use rules for naming.
Sample Code
Wrong
Right
Detection
We can set up policies and rules warning for certain words like base, abstract, helper, manager, object etc.
Tags
- Naming
Conclusion
Finding names is the last thing we should do on our designs. Unless we have a clear business understanding, good names emerge at the end after defined behavior and protocol boundaries.
Relations
More info
Credits
Photo by Rodion Kutsaev on Unsplash
There are only two hard things in Computer Science: cache invalidation and naming things.
Phil Karlton
💖 💪 🙅 🚩
Maxi Contieri
Posted on November 30, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.