Some topics, such as the importance of good design and documentation practices, may be difficult to convey due to the limitations of the academic setting. One way around this is to have students review and work with a sizable body of someone else's code. This is also more similar to the tasks they will face professionally than the standard programming assignments. Our field is dynamic enough that every class can explore truly new areas. Students react positively when they see themselves engaged in a mutual exploration of new territory rather than simply following a beaten path.
Students are more motivated to learn if they believe the material is relevant.
I base assignments on real problems and real data, where possible. Students need to learn to plan their work. Large projects, in particular, need to have frequent and clear milestones. Tests and examinations serve multiple roles. They provide motivation to students to study areas that may not be directly addressed by their assignments.