A Simple Zero to Hero Naming Formula! Code Readability is Always Great.
Formula: IDDP SMSCP
Intention
Disinformation
Distinction
Pronounceable
Searchable
Mental Mapping
Solution Domain
Concept
Problem Domain
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.
Name should answer all the big questions like why it exists,what it does and how it is used.