Naming Things Is the Hard Part

There are two hard problems in computer science: cache invalidation, naming things, and off-by-one errors. The naming one is the one that quietly eats your afternoon while pretending to be trivial.

I have spent longer naming a function than writing it, and I regret none of that time, because the name is the part the next person actually reads. utils2, temp_final_v3, dataManagerManager — these are not names. They are confessions. They tell you exactly the moment someone gave up.

A good name is documentation that cannot drift out of date, because it is welded to the thing it describes. The code says what it does; the name says what it is for. Spend the extra minute. The next person to open this file might be you, at 2am, with no memory of any of it.

No comments yet — be the first.

Leave a comment

Comments are welcome — disagreement included, in the spirit of free speech. Come in good faith and keep it civil. Cruelty, spam, and bad-faith trolling get moderated out.