Code is read
far more than it's written.
You write a name once.
It gets read
a hundred times after.
So the name isn't for you,
typing it now.
It's for the stranger
scanning it at midnight,
trying to understand
what you meant.
A variable called "data"
tells them nothing.
A variable called "d"
tells them less.
The right name
answers the question
before they ask it.
What is this?
Why does it exist?
You paid to learn the concept.
A good name
hands that knowledge over
for free.
A bad one
makes every reader
pay again.
Don't name things
for the machine.
It doesn't care.
It runs "x" and "customerBalance"
exactly the same.
Name them for the human
who inherits this file
and has to guess
what was in your head.
Spend the extra second.
Say what you mean.
The clearest name
is the shortest path
between another's eyes
and your intent.
– Serguey Asael Shinder
Top comments (0)