Engineering · 3 min
A short rant on naming variables
data. data2. tempData. finalData. finalData2_actual.
I have seen all of these in the same file. I may have written two of them.
Naming is hard because it forces you to actually understand what the thing is before you're allowed to move on — which is exactly why it's worth the extra ten seconds. A variable called data tells the next reader (often future-you, at 11pm, under deadline) nothing. A variable called pendingLoanAdjustments tells them everything they need before they've read a single line of logic around it.
The rule I try to hold myself to: if I can't name it clearly, I probably don't understand it well enough yet to write it. The naming struggle is usually a design struggle wearing a disguise.