# Code Smell 38 - Abstract Names

*Avoid too abstract names. Names should have real world meaning*

# Problems

- Implemental Naming

- Meaningless names

- Broken [MAPPER](https://maximilianocontieri.com/what-is-wrong-with-software) and [Bijection](https://maximilianocontieri.com/the-one-and-only-software-design-principle) to real world entities.

# Solutions

1. Choose meaningful names.

2. Find metaphors.

3. Avoid words like *abstract*, *base*, *generic*, *helper*, *data*, *info* etc.

4. Use [rules](https://maximilianocontieri.com/what-exactly-is-a-name-part-ii-rehab) for naming.

# Sample Code

## Wrong

%[https://gist.github.com/mcsee/568bc61348f648e3e0db8434b59b92a2]

## Right

%[https://gist.github.com/mcsee/106a64e384b1348dea8b1d486b4bacc5]

# 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

%[https://maximilianocontieri.com/code-smell-22-helpers]

%[https://maximilianocontieri.com/code-smell-25-pattern-abusers]

# More info

%[https://maximilianocontieri.com/what-exactly-is-a-name-part-ii-rehab]

# Credits

Photo by <a href="https://unsplash.com/@frostroomhead">Rodion Kutsaev</a> on <a href="https://unsplash.com/s/photos/abstract">Unsplash</a>

* * *

> There are only two hard things in Computer Science: cache invalidation and naming things.

_Phil Karlton_

%[https://mcsee.hashnode.dev/software-engineering-great-quotes]

* * *

This article is part of the CodeSmell Series.

%[https://mcsee.hashnode.dev/how-to-find-the-stinky-parts-of-your-code]
