Code Smell 79 - TheResult

Code Smell 79 - TheResult

If a name is already used, we can always prefix it with 'the'.

Maxi Contieri
·Jun 14, 2021·

1 min read

Subscribe to my newsletter and never miss my upcoming articles

Play this article

Table of contents

  • Problems
  • Solutions
  • Refactorings
  • Sample Code
  • Detection
  • Tags
  • Conclusion
  • Relations
  • More info
  • Credits

TL;DR: don't prefix your variables.


  • Readability

  • Meaningless names


  1. Use intention revealing names.

  2. Avoid Indistinct noise words.


Sample Code


var result;

result = getSomeResult();

var theResult;

theResult = getSomeResult();


var averageSalary;

averageSalary = calculateAverageSalary();


var averageSalaryWithRaises;

averageSalaryWithRaises = calculateAverageSalary();


As with many of our naming conventions, we can instruct our linters to forbid names like theXxx....


  • Readability


Always use intention revealing names.

If your names collide use local names, extract your methods and avoid 'the' prefixes.


More info


Photo by Josue Michel on Unsplash

One difference between a smart programmer and a professional programmer is that the professional understands that clarity is king. Professionals use their powers for good and write code that others can understand.

Robert C. Martin

This article is part of the CodeSmell Series.

Share this


Technical Opinions are my own. I don't have the revealed truth.

Software Design is a creative activity. These are hints and not rigid rules.

I write on BackEnd Business Systems and OOP Design. My advice/experience might not suit other systems.

You can write me at info(at)