# Code Smell 188 - Redundant Parameter Names

> TL;DR: Don't repeat your parameters' names. Names should be contextual.

# Problems

* Duplication
    
* Readability
    

# Solutions

1. Remove the repeated part from the name
    

# Context

When using names, we often miss that words are contextual and need to be read as a whole sentence.

# Sample Code

## Wrong

```plaintext
class Employee
  def initialize(@employee_first_name : String, @employee_last_name : String, @employee_birthdate : Time)
  end
end
```

## Right

```plaintext
class Employee
  def initialize(@first_name : String, @last_name : String, @birthdate : Time)
  end
end
```

# Detection

\[X\] Semi-Automatic

We can check our parameter names and try to find duplication.

# Tags

* Naming
    

# Conclusion

Use short and contextual names for your parameters.

# Relations

%[https://maximilianocontieri.com/code-smell-174-class-name-in-attributes] 

%[https://maximilianocontieri.com/code-smell-87-inconsistent-parameters-sorting] 

# Disclaimer

Code Smells are just my [opinion](https://maximilianocontieri.com/i-wrote-more-than-90-articles-on-2021-here-is-what-i-learned).

# Credits

Photo by [Wolfgang Hasselmann](https://unsplash.com/@wolfgang_hasselmann) on [Unsplash](https://unsplash.com/photos/Y3RVsHBeK7c)

---

> As a rule, software systems do not work well until they have been used, and have failed repeatedly, in real applications.

*David Parnas*

%[https://maximilianocontieri.com/software-engineering-great-quotes] 

---

This article is part of the CodeSmell Series.

%[https://maximilianocontieri.com/how-to-find-the-stinky-parts-of-your-code]
