
TL;DR: Classes represent concepts. And concepts are singular.
Problems
Naming
Code Standards
Solutions
- Rename classes to singular
Context
Naming things is hard.
We need to agree on certain rules.
Sample Code
Wrong
class Users
Right
class User
Detection
[X] Automatic
This is a syntactic rule.
Tags
- Naming
Conclusion
Name concepts in the singular.
Classes are concepts.
More Info
Disclaimer
Code Smells are just my opinion.
Credits
Photo by Anton Malanin on Unsplash
We are still in the infancy of naming what is really happening on software development projects.
Alistair Cockburn
This article is part of the CodeSmell Series.
About the author
I’m a senior software engineer loving clean code, and declarative designs. S.O.L.I.D. and agile methodologies fan.
Comments
Join the discussionNo comments yet. Be the first to comment.
Code Smells
In this series, we will see several symptoms and situations that make us doubt the quality of our developments. We will present possible solutions. Most are just clues. They are no hard rules.





