4 ms·
Code using single letter variable names and abbreviations makes people up to 15% slower at understanding code [1, 2]. Of course it is possible to determine - b
by cessor 10y ago
Code using single letter variable names and abbreviations makes people up to 15% slower at understanding code [1, 2].
Of course it is possible to determine - bottom up - what a variable is supposed to do or that p is short for pointer, it still slows others down because it requires them to perform mental mapping. This effect, of course, depends on experience. If you write your vars like this all the time your penalty won't be as big.
[1] Influence of identifier length and semantics on the comprehensibility of source code, https://github.com/cessor/bachelor-thesis https://github.com/cessor/bachelor-thesis
[2] Much shorter version published in
https://fg-sre.gi.de/fileadmin/gliederungen/fg-sre/wsre2016/WSRE-2016-Proceedings-2.pdf https://fg-sre.gi.de/fileadmin/gliederungen/fg-sre/wsre2016/...
- abecedarius 10y agoUpvoted, but I'll add that I'm surprised at how small you found the effect of naming things a,b,c,... with no mnemonics at all. (I skimmed the shorter paper.)