# Code Smell 265 - Linguistic Confusion

> TL;DR: Naming is hard, don't make it harder with unnecessary accidental complexity.

# Problems

- Unclear, misleading, vague, and ambiguous names 

- Redundant terminology 

- Confusing abstractions

- Cryptic [abbreviations](https://maximilianocontieri.com/code-smell-33-abbreviations)

# Solutions

1. Simplify naming conventions

2. Ensure consistency

3. Avoid unnecessary [jargon](https://maximilianocontieri.com/what-exactly-is-a-name-part-ii-rehab)

4. Use [descriptive names](https://maximilianocontieri.com/what-is-wrong-with-software) based on behavior

5. Maintain consistent terminology

# Context

[Ludwig Wittgenstein](https://en.wikipedia.org/wiki/Ludwig_Wittgenstein) argued that much confusion arises from language misuse.

This happens when you overcomplicate names, mix metaphors, or use inconsistent terminology. 

When you name classes, methods, or variables without clarity, you create a linguistic maze that others struggle to navigate. 

This causes bugs, makes maintenance harder, and leads to team frustration.

# Sample Code

## Wrong

[Gist Url]: # (https://gist.github.com/mcsee/9333f3505a7ffaba61e7e8509e2797d1)

```java
public class AbstractDataHandlerManager {
    private String dtStr;
    
    public void execProcessingOps(String input) {
        if (dtStr != null && !dtStr.isEmpty()) {
            // process
        }
    }
}
```

## Right

[Gist Url]: # (https://gist.github.com/mcsee/61de3fb3c822b5a14be3a80df6cae63d)

```java
public class SETIProcessor {
    
    public void processSignal(String input) {      
            // process
        }
    }
}
```

# Detection

[X] Manual

You can detect this smell when names start to get long, or when you see "[Abstract](https://maximilianocontieri.com/code-smell-38-abstract-names)", "Manager," "Handler," "[Helper](https://maximilianocontieri.com/code-smell-22-helpers)", or "[Data](https://maximilianocontieri.com/code-smell-113-data-naming)" too often. 

Another sign is when you must explain what a name means to other developers for example in a code review.

# Tags

- Naming

# Level

[X] Beginner

# AI Generation

AI generators often create this smell by producing verbose and generic names that attempt to cover every possible context. 

They are experts in many domains and write code, but frequently they don't do [both at once](https://www.youtube.com/watch?v=99GuXTIW0R4) unless instructed.

# AI Detection

AI generators can sometimes fix this smell with simple refactoring instructions like "simplify names" or "remove redundant terms," but struggle with deeper contextual understanding.

# Conclusion

Linguistic confusion in code leads to unnecessary complexity. 

Use clear, consistent, and straightforward naming to make your code easier to read and maintain.

# Relations

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

%[https://maximilianocontieri.com/code-smell-38-abstract-names]

%[https://maximilianocontieri.com/code-smell-197-gratuitous-context]

%[https://maximilianocontieri.com/code-smell-113-data-naming]

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

# More Info

%[https://the-philosophers-shirt.com/en-int/blogs/philosophical-dictionary/wittgenstein-linguistic-confusion]

%[https://maximilianocontieri.com/what-is-wrong-with-software]

%[https://maximilianocontieri.com/what-exactly-is-a-name-part-i-the-quest]

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

# Disclaimer

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

# Credits

Photo by [Mimi Thian](https://unsplash.com/@mimithian) on [Unsplash](https://unsplash.com/photos/woman-sitting-on-yellow-armless-chair-near-gray-laptop-computer-lp1AKIUV3yo)
    
* * *

> The greatest enemy of clear language is insincerity.

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