TL;DR: Don't repeat your parameters' names. Names should be contextual.
- Remove the repeated part from the name
When using names, we often miss that words are contextual and need to be read as a whole sentence.
class Employee def initialize(@employee_first_name : String, @employee_last_name : String, @employee_birthdate : Time) end end
class Employee def initialize(@first_name : String, @last_name : String, @birthdate : Time) end end
We can check our parameter names and try to find duplication.
Use short and contextual names for your parameters.
Code Smells are just my opinion.
As a rule, software systems do not work well until they have been used, and have failed repeatedly, in real applications.
This article is part of the CodeSmell Series.