A Resource to Support Novices Refactoring Conditional Statements

16Citations
Citations of this article
10Readers
Mendeley users who have this article in their library.
Get full text

Abstract

Novice programmers naturally focus on writing code that is functionally correct over writing code that is readable and efficient. This emphasis on correctness over style is encouraged by the ubiquitous use of automated grading tools. Consequently, teaching students to write succinct, readable code that uses language-appropriate idioms is a challenge for educators. Prior work in computing education has catalogued the common code smells and anti-patterns often present in code produced by novices. However, there remains a need for good teaching resources and, importantly, evidence that these resources are both usable by students and produce the intended outcomes. In this paper, we propose a lab-based resource to help novices identify and refactor code smells when writing conditional statements. Our resource consists of four rules for simplifying conditionals that are derived from prior literature, and three accompanying practice tasks to which students can apply the rules. We describe our first experience using this resource in a large introductory programming course and explore (1) how well students use the provided rules to simplify correct but inelegant code, and (2) whether any effects persist on later code writing tasks. We found that students understood the rules and were able to apply them effectively to examples containing common code smells. We also found evidence that students continued to write more succinct code two weeks after using the resource. Finally, we make our resource available so that it can be adopted by other educators.

Cite

CITATION STYLE

APA

Izu, C., Denny, P., & Roy, S. (2022). A Resource to Support Novices Refactoring Conditional Statements. In Annual Conference on Innovation and Technology in Computer Science Education, ITiCSE (Vol. 1, pp. 344–350). Association for Computing Machinery. https://doi.org/10.1145/3502718.3524810

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free