A Resource to Support Novices Refactoring Conditional Statements.

Cruz Izu,Paul Denny, Sayoni Roy

Annual Conference on Innovation and Technology in Computer Science Education (ITiCSE)(2022)

引用 7|浏览2
暂无评分
摘要
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.
更多
查看译文
关键词
novice programmers, code quality, refactoring, conditionals
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要