2 ms·
> why not ps, r and rs respectively? Um... Because that would be hard to read? I'm advocating using full words in general, avoiding long variables (multi-word
by snprbob86 15y ago
> why not ps, r and rs respectively?
Um... Because that would be hard to read?
I'm advocating using full words in general, avoiding long variables (multi-word phrases, adjectives, contextualization, etc), and not being afraid of short variables names if they help, rather than hurt readability.
There are plenty of cases where short names are totally fine. If you've got a module full of string utilities and every single function takes a first argument of type String, why not just call it "s"? Everyone will figure it out in seconds and it will save the mental overhead of differentiating "String" and "string". when that does come up.
Things like that; I'm saying use your judgement.