3 ms·
>the microscopic savings in key presses are just really such a strange thing to even debate It's about readability
by Yasuraka 3y ago
>the microscopic savings in key presses are just really such a strange thing to even debate
It's about readability
- cpeterso 3y agoStudies of program verbosity have shown that long vs short names have little impact in other programmers' reading comprehension or code maintainability.
- lelanthran 3y agoTIL. Do you remember which languages they looked at?
- cpeterso 3y agoI can't find the study I was thinking about, but here are two other studies I found. Neither study directly supports what I had recalled, but one study concludes longer names are more productive and the other concludes shorter names. :) How well these academic studies apply to production code is another question... * "Shorter [C#] identifier names take longer to comprehend" (2019) https://link.springer.com/article/10.1007/s10664-018-9621-x https://link.springer.com/article/10.1007/s10664-018-9621-x In this paper, we investigate the effect of different identifier naming styles (single letters, abbreviations, and words) on program comprehension. We conducted an experimental study with 72 professional C# developers who had to locate defects in source code snippets. ... We found that word identifiers led to a 19% increase in speed to find defects compared to meaningless single letters and abbreviations, but we did not find a difference between letters and abbreviations. * "[Java] Identifier length and limited programmer memory" (2009) https://www.sciencedirect.com/science/article/pii/S0167642309000343 https://www.sciencedirect.com/science/article/pii/S016764230... names used in existing production code are long enough to crowd programmer’s short-term memory. This provides evidence that software engineers need to consider shorter, more concise names. As the study considers individual names extracted from production code, it tends to underestimate the demand on memory because there is no need to remember context as well. * "Evaluation of Rust code verbosity, understandability and complexity" (2021) https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7959618/ https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7959618/
- Yasuraka 3y agoExperts[1] agree that boilerplatey declarations and verbose keyword groupings are bad and Java has been deemed inhumane because of this. [1]Me