I'm getting into the more advanced programming classes at my university, and feel like I am running into some obvious shortcomings with producing quality code.
For example, my data structures class has us reading in a list of songs, creating Song objects, then using various structures to implement searches for artists, titles, lyric words and lyric phrases. The professor gives us a list of test examples to prove the code produces the expected results, and the grades are based on functionality, completeness, and bug awareness. Currently I am holding a 90 average in that class, but am not really satisfied that my code is of good quality.
So, what techniques did your college professors use to get you to write better code?