CSM: A Code Style Model for Computing Educators
Diana Kirk, Andrew Luxton-Reilly, Ewan TemperoObjectives Code style is an important aspect of text-based programming because programs written with good style are considered easier to understand and change and so improve the maintainability of the delivered software product. However teaching code style is complicated by the existence of many style guides and standards that contain inconsistent, low-level advice. The objective of the study is to support educators in helping students understand the nature of these inconsistencies by highlighting the rationale behind rules and their contextual nature.
Participants Seventy members of local and national computing science education (CSE) groups contributed in the exploratory phase. Fifty-two members of the ACM SIGCSE members mailing list and the Australasian Chapter contributed in the evaluation and refinement phases. These mailing lists represent a large, global population of CSE educators.
Study Methods We created, evaluated and refined an abstract code style model ( CSM ) comprising a Definition and eight Principles for code style. For CSM creation, we took an exploratory approach based on an examination of the existing literature on code quality and style. To evaluate the level of community endorsement for the model, we analysed quantitative and qualitative data from an international survey questionnaire. We refined the CSM based on an analysis of the qualitative survey data.
Findings Analysis of the data from the survey indicated a strong level of support for the CSM . Quantitative data revealed a general agreement with the Principles , with responses for five Principles achieving a minimum of 84 percent agreement and all Principles achieving a minimum of 66 percent agreement. Qualitative data contained very few comments that voiced dissatisfaction with a basic aspect of the model. We found that barriers to developing a community-wide CSM were the strongly-held beliefs about style held by some and the abstract nature of the CSM .
Conclusions The creation of an abstract set of Principles for code style is generally perceived by the community to be worthwhile and important and our approach has high levels of endorsement. A validated version of the CSM has been created.