How can I show the value of best practices? As someone who likes to advocate for best practices like correct use of VCS, indentation, sufficient commenting, and testing, I try and integrate them when I teach. But for all of these things, my students always ask me why they need to do it for projects of the relatively small size and short duration they're working on. They're right that it isn't necessary, but I don't know how else to teach it and get them to practice it.

What ways do you find effective to introduce programming best practices? How do you ensure that your students continue to use them?
I've faced resistance too. Here are some ideas:


Students would not turn in an assignment to an English teacher that was not properly punctuated and proofread, even if that teacher will be the only reader. They should not turn in an assignment to a CS teacher that is not properly formatted, documented, and tested.
Companies want to hire programmers capable of writing scalable programs. I can write a much stronger letter of recommendation for students who do well at this. (Adapt to college letters of recommendation for high school students.)
Rhetorically ask why people try their best when practicing CPR on a dummy.
When I interviewed job candidates for Google, I asked questions about testing. It would be hard for candidates to answer well without having practiced writing tests.
Give prizes for and share examples of student code that follows best practices. (Get a student's permission before sharing their code.)
Show them disastrous bugs that came from not following best practices, such as this one.