Naming Matters

Choosing a name has a huge impact on the readability of the code.

In this post, I will walk you through some of the bad and good examples which might convince you why naming matters.

Project directories:

Three projects, guess which one is admin site, native mobile app, and restful API?

Can you guess which project serves as an admin website, mobile app, and server-side API’s? The developer not only failed to give attention to naming but also masked his intent with some other words. Confusing?


The sentence:

P and Q went to R. They had a good dinner at S followed by T and then they came back to U.

Could you read the above sentence and understand it’s clear intent. For me, it’s difficult to understand due to the usage of abbreviations. It will lead me to different assumptions.


Code snippet:

Random code snippet

I am sure you have figured out what the code is doing. However, it was not that easy to figure out this code snippet.

Now think about a project that contains more than 1000+ classes, modules, methods, files, and many more.

The complexity and frustration will be increased in the same magnitude if developers don’t give attention while naming those.

Don’t you think it will be painful for the maintenance developer as well as your future-self to visit and understand the intent behind the code?


Real-life analogy

Everything in this world has meaningful names. It helps our brain to understand, remember and figure out the things at ease. It means less mental mapping.

Photo by Bernard Hermant on Unsplash

When you visit hypermarket, you could easily figure out groceries, fruits, cosmetics and so on.

You could easily fetch handwash, facewash, aftershave, sanitizer, liquid sanitizer, moisturizer, cold-drinks, cookies, water bottle and so on. Thanks to proper naming to the categories, items and so on.Naming matters!


Let’s revisit the above examples with careful naming.

Project directories:

Uglier way:


Three projects, guess which one is admin site, native mobile app, and restful API?

Better way:

See projects after renaming, are you able to figure out which one is admin site, mobile app, and API at ease?

The sentence:

Uglier way:

P and Q went to R. They had a good dinner at S followed by T and then they came back to U.

Better way:

Tom and Jerry went to a Mall. They had a good dinner at a restaurant followed by a movie and then they came back to their Home.

Do you realize the power of effective naming?


Code snippet:

Uglier way:

Random code snippet

Better way:

Find the Volume and Surface Area of Cuboids

Just looking at code snippet, it is crystal clear that code is working on height, length, and breadth to compute surface area and volume.

Now with proper naming to the variables, A small code snippet with careful variable naming makes developers life easy.


Imagine what will happen to readability, understandability, and maintainability if you show the same dedication while naming everything in the project.

We as a programmer try to solve the customer requirement or problem by creating various projects.

These projects may have directories, assemblies, namespaces, packages, files, classes, modules, properties, fields, events, method arguments, method parameters, UI elements, UI attributes, UI styles, validators, services, translation files, translation keys, command-line utilities and many more.

All of these things should have a meaningful name so that they convey their intent. You should be able to figure out what they are doing by just looking at their name.

Perhaps they should answer all the big questions that you or future maintenance developers would have.

Naming matters! Please give attention to naming everything in the programming!


Dattatray Kale | Being software craftsman
I am an application developer based in Pune, India. I am willing to wait for the right opportunity – Datta CV PRACTICES…blog.beingcraftsman.com

Dattatraya Kale

Aspiring agile software craftsman, clean code, polyglot, in love with different programming paradigm. I am on a never-ending journey towards mastery of software.

Leave a Reply