3 ms·
The way I have seen this is that single letter variables are mostly used when declaration and (all) usages are very close together. If I see a loop with i or k
by VonGallifrey 2y ago
The way I have seen this is that single letter variables are mostly used when declaration and (all) usages are very close together.
If I see a loop with i or k, v then I can be fairly confident that those are an Index or a Key Value pair. Also I probably don't need to grep them since everything interacting with these variables is probably already on my screen.
Everything that has a wider scope or which would be unclear with a single letter is named with a more descriptive name.
Of course this is highly dependent on the people you work with, but this is the way it works on projects I have worked on.