Skip to content

Comment on Is anybody else using ridiculously long variable names?

Comments

Code is for humans to read and machines to execute. So as far as it is readable, I won't change long variable names. I've used long names many times, when it is deserved. Most of the times it is longer function/method names, or constants or configuration variables.

However, if a method/function is too long (i.e. too many lines in that single method/function) then it is very likely to have longer variable names within the scope and that method itself is likely to be a good candidate for refactoring. Sometimes the same applies to configuration variables (for example- stuff you read from a json config)

AboutSource Built by g1lg1l

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