|
|
|
|
|
by nl
3437 days ago
|
|
Ok, I accept you aren't trolling :) I find it difficult to agree that using non-representative names for variables or functions improves understadability. Notably, using something like x to represent a meaningful value means the brain has to hold the mapping between the two, which will decrease the number of useful pieces of information kept in short term memory[1]. The brain doesn't keep track of the number of characters in a variable name. [1] http://www.psych.utoronto.ca/users/peterson/psy430s2001/Mill... |
|
The issue, for me, is not readability but context. Even a word or two (e.g. cuts, begins, dims) helps greatly to establish the context of the code. Like having a map before hiking.
A comment can clearly provide that context without making the variable names long.
[1]: https://news.ycombinator.com/item?id=8747314
> The brain doesn't keep track of the number of characters in a variable name.
Surely you must appreciate that if we use too many characters the window will scroll?