一句话:通过访谈揭示入门 Python 教师对变量命名的信念、教学实践及其矛盾,呼吁有意识地教授命名。
变量命名是软件开发实践的一部分,影响程序理解与代码质量,但入门课程中如何教授命名尚不清楚。本文采用深度质性方法,访谈十位中学与高等教育入门 Python 课程教师,围绕其命名信念、自报教学实践及观察到的做法提炼主题。结果发现:教师普遍认同应使用有意义的名称,但对“有意义”的理解存在冲突;所述教学实践与自身观点并不总一致,且很少鼓励学生使用有意义名称,多认为命名规范不应强制、学生会通过示例自然习得。部分教师仅关注约定,另一些则安排专门时间让学生参与命名、制定自己的指南、提供持续反馈或在考试中包含命名练习。讨论指出命名实践并未被有意教授,且教师自报实践存在不一致,因而建议教育场景中开展关于命名的有意识对话,将命名与代码质量和可读性联系起来,并借助小组或同伴活动及形成性反馈促进命名教学。
Motivation. Variable naming practices are part of the software developer's profession, influencing program comprehension and code quality. Yet, little is known about how variable naming practices are taught in beginner courses. Objective. This paper investigates naming beliefs, self-reported teaching practices, and observations regarding variable naming practices of teachers of introductory Python programming courses. Methods. We adopted an in-depth qualitative approach by interviewing ten teachers from secondary education and higher education and developed several themes in order to answer our research questions. Results. Among various opinions and practices, we found that teachers agree on using meaningful names, but have conflicting beliefs about what is meaningful. Moreover, the described teaching practices do not always match teacher's views on meaningful names, and teachers rarely encourage students to use them. Instead, they express that naming practices should not be enforced and that students will develop them by example. Whereas some teachers report focusing solely on conventions, others deliberately dedicate time for students to engage with naming, create their own guidelines, provide continuous feedback, or include naming exercises on exams. Discussion. Naming practices do not seem to be deliberately taught, even though they influence program understanding and code quality. We also identified inconsistencies in teachers' self-reported naming practices. As such, we encourage intentional conversations about naming practices in educational settings, specifically linking naming to code quality and readability. We see room for group and peer activities as a means to this end, as well as providing formative feedback dedicated to naming.
@inproceedings{WerfSHSA24,
title = {Teachers' Beliefs and Practices on the Naming of Variables in Introductory Python Programming Courses},
author = {Vivian van der Werf and Alaaeddin Swidan and Felienne Hermans and Marcus Specht and Efthimia Aivaloglou},
booktitle = {ICSE},
year = {2024},
doi = {10.1145/3639474.3640069}
}