Block-based programming languages like Scratch enable children to be creative while learning to program. Even though the block-based approach simplifies the creation of programs, learning to program can nevertheless be challenging. Automated tools such as linters therefore support learners by providing feedback about potential bugs or code smells in their programs. Even when this feedback is elaborate and constructive, it still represents purely negative criticism and by construction ignores what learners have done correctly in their programs. In this paper we introduce an orthogonal approach to linting: We complement the criticism produced by a linter with positive feedback. We introduce the concept of code perfumes as the counterpart to code smells, indicating the correct application of programming practices considered to be good. By analysing not only what learners did wrong but also what they did right we hope to encourage learners, to provide teachers and students a better understanding of learners' progress, and to support the adoption of automated feedback tools. Using a catalogue of 25 code perfumes for Scratch, we empirically demonstrate that these represent frequent practices in Scratch, and we find that better programs indeed contain more code perfumes.
翻译:Scratch 等基于街区的编程语言使儿童在学习编程时能够发挥创造性。 即使基于街区的方法简化了程序创建程序, 学习程序也可能具有挑战性 。 因此, 诸如 Iinters 等自动工具通过提供潜在错误或程序内代码嗅觉的反馈支持学习者。 即使这种反馈十分详细且具有建设性, 它仍然代表纯粹负面的批评, 并且建筑忽视了学习者在编程中正确完成的工作。 在本文中, 我们引入了一种正反方向的方法: 我们用正面的反馈来补充一个互换器所产生的批评。 我们引入了代码香水的概念, 作为代码的对应器, 来调制成气味, 表明正确应用被视为好的编程做法。 我们不仅分析学习者做了哪些错误, 而且还分析他们希望做的正确, 来鼓励学习者, 使教师和学生更好地了解学习者的进步, 并支持采用自动反馈工具。 我们用25种代码香水目录来为Scratch, 我们用实验性地证明这些是Scratch 的常见做法。 我们发现, 更好的程序确实包含更多的代码香水。