CLEI Electronic Journal (Apr 2018)

Attributes Influencing the Reading and Comprehension of Source Code – Discussing Contradictory Evidence

  • Talita Vieira Ribeiro,
  • Guilherme Horta Travassos

DOI
https://doi.org/10.19153/cleiej.21.1.5
Journal volume & issue
Vol. 21, no. 1
pp. 5:1 – 5:33

Abstract

Read online

Background: Coding guidelines can be contradictory despite their intention of providing a universal perspective on source code quality. For instance, five attributes (code size, semantic complexity, internal documentation, layout style, and identifier length) out of 13 presented contradictions regarding their influence (positive or negative) on the source code readability and comprehensibility. Aims: To investigate source code attributes and their influence on readability and comprehensibility. Method: A literature review was used to identify source code attributes impacting the source code reading and comprehension, and an empirical study was performed to support the assessment of four attributes that presented empirical contradictions in the technical literature. Results: Regardless participants’ experience; all participants showed more positive comprehensibility perceptions for Python snippets with more lines of code. However, their readability perceptions regarding code size were contradictory. The less experienced participants preferred more lines of code while the more experienced ones preferred fewer lines of code. Long and complete-word identifiers presented better readability and comprehensibility according to both novices and experts. Comments contribute to better comprehension. Furthermore, four indentation spaces dominated the code reading preference. Conclusions: Coding guidelines contradictions still demand further investigation to provide indications on possible confounding factors explaining some of the inconclusive results.