Abstract
It is widely accepted that variable names in computer programs should be meaningful, and that this aids program comprehension. 'Meaningful' is commonly interpreted as favoring long descriptive names. However, there is at least some use of short and even single-letter names: using 'i' in loops is very common, and we show (by extracting variable names from 1000 popular github projects in 5 languages) that some other letters are also widely used. In addition, controlled experiments with different versions of the same functions (specifically, different variable names) failed to show significant differences in ability to modify the code. Finally, an online survey showed that certain letters are strongly associated with certain types and meanings. This implies that a single letter can in fact convey meaning. The conclusion from all this is that single letter variables can indeed be used beneficially in certain cases, leading to more concise code.
Original language | English |
---|---|
Title of host publication | Proceedings - 2017 IEEE 25th International Conference on Program Comprehension, ICPC 2017 |
Publisher | IEEE Computer Society |
Pages | 45-54 |
Number of pages | 10 |
ISBN (Electronic) | 9781538605356 |
DOIs | |
State | Published - 28 Jun 2017 |
Event | 25th IEEE International Conference on Program Comprehension, ICPC 2017 - Buenos Aires, Argentina Duration: 22 May 2017 → 23 May 2017 |
Publication series
Name | IEEE International Conference on Program Comprehension |
---|
Conference
Conference | 25th IEEE International Conference on Program Comprehension, ICPC 2017 |
---|---|
Country/Territory | Argentina |
City | Buenos Aires |
Period | 22/05/17 → 23/05/17 |
Bibliographical note
Publisher Copyright:© 2017 IEEE.
Keywords
- Program comprehension
- meaningful identifier names
- single-letter names