Last Revision — April 19, 2022
1 Min Read
---
Couplers
Names
Within a Class
- Flag Arguments (causes)
- Status Variable (co-exist)
- Side Effects (antagonistic)
Marcel Jerzyk in thesis (2022): "Code Smells: A Comprehensive Online Catalog and Taxonomy"
This is straightforward: method or function names that have binary bitwise operators like AND
and OR
are obvious candidates for undisguised violators of the Single Responsibility Principle right out there in the open. If the method name has and
in its name and then it does two different things, then one might ask why it is not split in half to do these two other things separately? Moreover, if the method name has or
then it not only does two different things but also, most likely, it has a stinky Flag Argument which is yet another Code Smell.
This code smell might happen not only in the method names, even though it is the place to look for in the vast majority of this kind of smell, but also in the variables.
Names with conjunction words strongly suggest that something is not responsible for just one thing.