I regularly teach an undergraduate course in which students are expected to complete projects that involve writing code. I also supervise undergraduates in other project and thesis work that involve writing code.
I am considering requiring future students to publicly release their project code, and any other materials needed to reproduce their work, under an open source license. (This would, of course, be stated up front in the syllabus, or before I agree to supervise a thesis student.)
(Fortunately, the research platform on which my students work is very well suited for reproducible research, having been designed specifically with that goal in mind.)
On the one hand, I have this vague idea that it's to the students' benefit to practice participating in open, reproducible science.
On the other hand, students may feel reluctant to release their code (for all of the reasons documented here). Furthermore, I want to avoid things that distract too much from the main goals of the course, which don't directly involve reproducible research.
Are there any specific pedagogical arguments for or against instituting this requirement?
(Note that I'm asking about the pedagogical impact on my students, not the benefit to the broader research community of having my students do open science.)