# Code Smell 153 - Too Long Names

> TL;DR: Names should be long enough. No longer.

# Problems

- Readability

- Cognitive Load

# Solutions

1. Use names related to the [MAPPER](https://maximilianocontieri.com/what-is-wrong-with-software)

# Context

We used [very short names](https://maximilianocontieri.com/code-smell-33-abbreviations) during the 50s and 60s due to space and time constraints.

This is no longer the case in modern languages.

Sometimes we get too excited.
 
Naming is an art and we should be cautious with it.

# Sample Code

## Wrong

[Gist Url]: # (https://gist.github.com/mcsee/661d68a82e80799c6f9330d33c271a0b)
```java
PlanetarySystem.PlanetarySystemCentralStarCatalogEntry

// Redundant
```

## Right

[Gist Url]: # (https://gist.github.com/mcsee/7da772566dee2fb79f3bfea13196ee22)
```java
PlanetarySystem.CentralStarCatalogEntry
```

# Detection

[X] Semi-Automatic 

Our linters can warn us with too long names.

# Tags

- Bloaters

- Naming

# Conclusion

There are no [hard rules](https://maximilianocontieri.com/what-exactly-is-a-name-part-i-the-quest) on name length.

Just Heuristics.

# Relations

%[https://maximilianocontieri.com/code-smell-33-abbreviations]

# More Info

- [What exactly is a name? — Part I: The Quest](https://maximilianocontieri.com/what-exactly-is-a-name-part-i-the-quest)

- [What exactly is a name? — Part II: Rehab](https://maximilianocontieri.com/what-exactly-is-a-name-part-ii-rehab)

- [Long and Short of Naming](https://agileotter.blogspot.com/2009/08/long-and-short-of-naming.html)

# Credits

Photo by [Emre Karataş](https://unsplash.com/@emrekaratas) on [Unsplash](https://unsplash.com/s/photos/long)
  
* * *

> Many people tend to look at programming styles and languages like religions: if you belong to one, you cannot belong to others. But this analogy is another fallacy.

_Niklaus Wirth_

%[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]
