共 1 条
Indentation and Reading Time: A Controlled Experiment on the Differences Between Generated Indented and Non-indented JSON']JSON Objects
被引:0
|作者:
Hanenberg, Stefan
[1
]
Morzeck, Johannes
Werger, Ole
[1
]
Gries, Stefan
[2
]
Gruhn, Volker
[1
]
机构:
[1] Univ Duisburg Essen, D-45127 Essen, Germany
[2] Codecentric AG, D-42697 Solingen, Germany
来源:
关键词:
Programming;
Readability;
Indentation;
D O I:
10.1007/978-3-031-61753-9_4
中图分类号:
TP18 [人工智能理论];
学科分类号:
081104 ;
0812 ;
0835 ;
1405 ;
摘要:
It is commonly accepted to indent source code to improve its readability, but the evidence for that is quite low. Up to 2022 only few experiments can be found that reveal a positive effect of indentation in terms of reported evidence and reported effect size - actually, the authors of the present paper are only aware of one single experiment up to 2022 that matches the previous statement. In other words, the often articulated positive effect of indentation was hardly backed up by experimental results reported in the literature. The situation changed in 2023, where an experiment suddenly revealed a strong (p<.001) and large (effect size =.832; ratio of means =2.781) effect of indentation in code consisting of if-statements, i.e., a large effect of indentation on the readability of control flows was measured. However, taking the history of studies on indentation into account, it is reasonable to doubt the results: possibly, the effect was caused by hand-chosen examples, respectively by the kind of code used in the experiment (control flows). The here presented study is a follow-up study. First, instead of using hand-chosen examples, the experiment uses generated code. Next, instead of relying on an application's control flow, the present study focusses on data structures by using JSON objects. And finally, the study was designed as a replicated N-of1 experiment executed on 40 professional developers, where each single subject receives multiple repetitions of all treatment combinations. The study showed a strong (p<.001) and large (effect size =.596; ratio of means =6.44) effect of indentation. A further finding was that the indentation effect varies between participants. And finally, the study's results are comparable to the results achieved by running the experiment only on four of the present paper's authors.
引用
收藏
页码:50 / 75
页数:26
相关论文