Skip to content

Comment on Ask HN: I prefer single letter variablesparent

Comments

I don't think we're talking about the same things.

Not 5 years later, and when it is someone else's code. Just don't.

That's precisely when you rewrite more: when the initial context is gone.

Initialisms are no better than single char var names.

Correct.

No one later is going to know you started naming "SmartFooProcessingThing" as "sfpt" and when they search for it in millions of lines of the codebase, they are gonna come up empty and waste time.

They're not meant to be grepped for. They're meant to be local, fleeting, names for something.

There is nothing you should be finding "satisfying" in a non-obvious piece of code.

There is. When you understand it, it's satisfying. Or so has been my experience. There's also the frustration of "why was this left like this in the first place", but sometimes it's merely a matter of preference.

Please note that I'm advocating for rewriting and throwing away things you don't understand, not for leaving puzzles for others to relish on.

And if you are working on team, there should be nothing "in your native style". Don't be that person.

Indeed.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.