3 ms·
> Use short enough and long enough variable names in each scope of code. Generally length may be 1 char for loop counters, 1 word for condition/loop variables,
by ericb 15y ago
> Use short enough and long enough variable names in each scope of code. Generally length may be 1 char for loop counters, 1 word for condition/loop variables, 1-2 words for methods, 2-3 words for classes, 3-4 words for globals.
---
A variable name, function, or class name, should be exactly as short as it can be and still usefully to convey its purpose to someone who is not the code's author--no longer, no shorter. Their "best practice" was backed into by counting how many words it usually takes to convey this information, but the horse goes in front of the cart.