DEV Community

Cover image for Code Smell 98 - Speling Mistakes
Maxi Contieri
Maxi Contieri

Posted on • Originally published at maximilianocontieri.com

4 1

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

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();
Enter fullscreen mode Exit fullscreen mode

Right

comboFedBySupplier = supplier.providers();
Enter fullscreen mode Exit fullscreen mode

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

Conclusion

Pay close attention to your names.

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

More Info

Credits

Photo by Brett Jordan on Unsplash

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

C.A.R. Hoare


This article is part of the CodeSmell Series.

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay