3 ms·
That's kind of a pathological case you have there - I don't think many people would argue that loop indices should have long variable names. None of the example
by lemming 15y ago
That's kind of a pathological case you have there - I don't think many people would argue that loop indices should have long variable names. None of the examples in your post above were loop variables, and what I see a lot of in lisp code is using ps for players, for example. In your example you've used pretty sensible names for players, rank and render_score - why not ps, r and rs respectively?
- 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.