A Simple Zero to Hero Naming Formula! Code Readability is Always Great.

Dhruba Dahal | Software Engineer
4 min readFeb 13, 2022

Formula: IDDP SMSCP

Intention
Disinformation
Distinction
Pronounceable
Searchable
Mental Mapping
Solution Domain
Concept
Problem Domain

Photo by AltumCode on Unsplash

It is not easy to name a class, function, or a variable that would make your grandmother understand what you doing in your code. However, it is achievable with continuous practice and a sufficient level of commitment. Choosing good names takes time but it gives more than it takes.

Today, I would like to share some tips that I found useful to achieve a better naming skill:

Think about the intention before giving a name

How do we find if a name could not reveal the intention? Simple answer is if it requires a comment.

A variable name r which does not give any meaning

Name should answer all the big questions like why it exists,what it does and how it is used.

--

--