Skip to content

Latest commit

 

History

History
93 lines (50 loc) · 2.38 KB

File metadata and controls

93 lines (50 loc) · 2.38 KB

Code Smell 98 - Speling Mistakes

Code Smell 98 - Speling Mistakes

Spelling and readability are very important for humans and not important for machines.

TL;DR: Take care of your names.

Problems

  • Readability

  • Harder to search terms in code.

Solutions

  1. Spellcheck your code.

  2. Use an IDE with spellchecking

Context

Many of us don't speak English as our first language.

We need to have extra care for our texts and names.

This article has a typo in its title as proof of context and also a clickbait😀

Sample Code

Wrong

comboFeededBySupplyer = supplyer.providers();

Right

comboFedBySupplier = supplier.providers();

Detection

[X] Manual

  • We need to read the code in a peer review.

[X] Automatic

  • Some IDEs have warnings on the typos.

Tags

  • Readability

  • Naming

  • Code Styling

Conclusion

Pay close attention to your names.

You will probably be the person reading the code in a few months.

Relations

Code Smell 48 - Code Without Standards

More Info

What exactly is a name - Part I The Quest

What exactly is a name - Part II Rehab

Credits

Photo by Brett Jordan on Unsplash

Inside every well-written large program is a well-written small program.

C.A.R. Hoare

Software Engineering Great Quotes


This article is part of the CodeSmell Series.

How to Find the Stinky Parts of your Code