indented or non–indented code but rather on some
other facets of the code. For example, in Section 4 we
discussed a possible question of how many lines of
code some code snippet contains. If a questionnaire
contains a number of questions that do not focus on
the possible effect of indentation, we think that such
questionnaires are rather inappropriate to be used in
a study that focuses on indentation. I.e., the result-
ing studies that end up with null results do not indi-
cate that indentation has no effect. Instead, it simply
means that under the experimental conditions no ef-
fect could be measured (which is an important differ-
ence, because such null effects are possibly caused by
inappropriate experimental designs).
Finally, we think that the present paper gives some
more insights about a phenomenon that was studied
by Johnson et al. (Johnson et al., 2019) as well as
Ajami et al. (Ajami et al., 2019): both works identi-
fied that the deeper the nesting, the harder is it for de-
velopers to understand the code. Actually, the present
paper says that nesting has another effect: the pres-
ence of nesting indicates code that can be skipped
while reading (under some circumstances). I.e., the
question is not only how deep a nesting is, but how
much code is actually nested. We think that this is-
sue deserves more studies in the future, because the
present study was not able to reveal this effect: al-
though the variable skipping was significant, the study
did not find a difference between mixed and skip-
pable. I.e., future work should address this in order
to find an explanation for the readability differences
between indented and non-indented code.
8 CONCLUSION
The main point of the present work is that indentation
is an important issue in education and development –
but there is so far not much evidence in the scientific
literature that indentation actually matters.
The present work shows that indentation has – at
least in the context of control flows – a large, posi-
tive effect in comparison to non-indented code. But it
also shows something different: The effect of inden-
tation is not a fixed factor. It depends on other factors
as well and the present work identified “code skip-
ping” as such an influencing factor with larger effects
on the difference between indented and non-indented
code. However, the experiment was not able to re-
veal a readability difference between skippable code,
something that should be addressed in future work.
To conclude, we think that the present paper could
be used to tell students or professional developers
why indentation matters. The answer from the present
experiment is: Because it saves a lot of time when
reading code. We might not know how much time it
saves for some given code basis (where multiple, ad-
ditional factors influence the readability of the code).
But in the reported experiment, non-indented code re-
quired between 142% and 269% more time to deter-
mine the output of the code.
Note
A replication package of the experiment is available
via https://drive.google.com/drive/folders/1ZVDMfT
BDIvpKF0uQtZemhmvH_LxoUODf. There, also the
raw measurements of the experiment are available.
REFERENCES
Ajami, S., Woodbridge, Y., and Feitelson, D. G. (2019).
Syntax, predicates, idioms — what really affects
code complexity? Empirical Software Engineering,
24(1):287–328.
Al Madi, N., Peng, S., and Rogers, T. (2022). Assessing
workload perception in introductory computer science
projects using nasa-tlx.
Albayrak, O. and Davenport, D. (2010). Impact of main-
tainability defects on code inspections. In Proceed-
ings of the 2010 ACM-IEEE International Sympo-
sium on Empirical Software Engineering and Mea-
surement, ESEM ’10, New York, NY, USA. Associ-
ation for Computing Machinery.
Bauer, J., Siegmund, J., Peitek, N., Hofmeister, J. C., and
Apel, S. (2019). Indentation: Simply a matter of
style or support for program comprehension? In
Proceedings of the 27th International Conference on
Program Comprehension, ICPC ’19, pages 154–164.
IEEE Press.
Binkley, D. W., Davis, M., Lawrie, D. J., Maletic, J. I., Mor-
rell, C., and Sharif, B. (2013). The impact of identifier
style on effort and comprehension. Empir. Softw. Eng.,
18(2):219–276.
Couceiro, R., Duarte, G., Durães, J. a., Castelhano, J. a.,
Duarte, C., Teixeira, C., Branco, M. C., de Carvalho,
P., and Madeira, H. (2019). Biofeedback augmented
software engineering: Monitoring of programmers’
mental effort. In Proceedings of the 41st Interna-
tional Conference on Software Engineering: New
Ideas and Emerging Results, ICSE-NIER ’19, pages
37–40. IEEE Press.
Crosby, M. E., Scholtz, J., and Wiedenbeck, S. (2002). The
roles beacons play in comprehension for novice and
expert programmers. In Proceedings of the 14th An-
nual Workshop of the Psychology of Programming In-
terest Group, PPIG 2002, London, UK, June 18-21,
2002, page 5. Psychology of Programming Interest
Group.
Fritz, T., Begel, A., Müller, S. C., Yigit-Elliott, S., and
Züger, M. (2014). Using psycho-physiological mea-
Indentation in Source Code: A Randomized Control Trial on the Readability of Control Flows in Java Code with Large Effects
127