Abstract

The relationship between programming style and program readability has never been examined empirically, although the association has substantial importance for both pedagogical and industry best practices. This paper studies a fractal, relativistic measure of programming style called the beauty factor or “beauty” and puts forward two new hypotheses of beauty. First, code with increasing beauty tends to be more readable. Second, beauty measures a unique property in code called aesthetic value distinct from readability. These hypotheses are tested on a corpus of 53,000 lines of open source system codes written by experienced Linux programmers. Statistical correlation analysis is used on 11 different beauty factors versus eight different readability models (i.e., 88 experiments total). As the primary finding, the data show the maximum absolute statistically significant correlation is |p|=0.59 whereas the absolute median correlation is |p|=0.33. In other words, at least 65% of statistically significant variations in beauty cannot be explained by variations in readability; approximately 90% of statistically significant variations in beauty cannot be explained typically by variations in readability. These results lend support to both hypotheses. The data further shows indentation is more reliably correlated with readability than mnemonics or comments and GNU style is more correlated with readability than K&R, BSD, or Linux styles.

Highlights

  • In 1979 AT&T Bell Labs released Unix version 7 which included cb, the C beautifier [2]

  • This paper studies a relativistic, fractal measure of programming style called the beauty factor and puts forward two new hypotheses

  • These investigations of beauty resemble efforts by researchers who used fractal geometry to assess aesthetic www.ijacsa.thesai.org (IJACSA) International Journal of Advanced Computer Science and Applications, Vol 9, No 9, 2018 values in paintings, including Pollock‘s ―action paintings‖ [16,17,18,19,20]; the main technical differences are that this paper studies code as opposed to fine art and programming style as opposed artistic style

Read more

Summary

Introduction

In 1979 AT&T Bell Labs released Unix version 7 which included cb, the C beautifier [2]. Software engineers did not address the ontology of what is beauty in code. They instead focused on the epistemology of what is knowable about such beauty which could be automated, demonstrated, practiced, and taught. They had hoped paying attention to sensori-emotional or aesthetic values in code might promote readability of code. The long-held, widely taught, and often repeated justification for good style is to make programs more readable and presumably, more maintainable [7]

Methods
Discussion
Conclusion
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call