That's how it worked in my university. The C++/data-structures course sort of doubled as a "good coding habits" course. The formal course content was an introduction to OOP (via C++) and standard data structures, but we were also expected to format our code well, understand what a useful level of commenting is, understand testing, and use version control, and there were parts of lectures devoted to those. The course was taught by an old-school Unix greybeard, though, so the version control system we used was RCS, of all things.
My Software Engineering degree had a course called Personal Software Process that covered all of that and more. It was fantastic as it really emphasized how code quality and controls are the responsibility of the individual engineer.