5 ms·
Nobody said anything against really short names.
by petdance 14y ago
Nobody said anything against really short names.
- pohl 14y agoYou don't consider "data".length() == 4 to be short?
- alex_c 14y agoNobody said anything against really short names, the article argues against non-descriptive variable names, whether short or long.
- evincarofautumn 14y agoIndeed, provided you know the problem domain, the most descriptive name (xs, x_rms) is almost always far shorter than the literal alternative (horizontal_positions, quadratic_mean_of_horizontal_positions).
- deleted 14y ago[deleted]
- Lockyy 14y agoWhy are you working under the assumption that that was his issue with the term data? Especially when he specifically described his problems with it.
- pohl 14y agoI'm not. Rather, I'm supporting the notion that as the relevant scope decreases, the weight of his objections to the variable name 'data' vanish and become dominated by the value of its brevity.
- mokus 14y agoThe same argument applies to non-descriptive names, and the main complaint about short names is that they are often not descriptive. I like to bring up the English language in this particular debate. "It", "he", and "she" are incredibly non-descriptive names, but each one of them is used many orders of magnitude more often than any "descriptive" name (other than maybe "I" or "you") and yet we don't hear rants about that. The reason is exactly what the original commenter pointed out - scope. Sometimes the word "it" is descriptive enough all by itself. Other times it isn't. It's a more subtle matter than "worst variable names".
- riffraff 14y ago> Sometimes the word "it" is descriptive enough all by itself. Other times it isn't. It's a more subtle matter than "worst variable names". I see what you did there.