Slight tangent to your question, but one thing I have noticed recently is that having to deal with really crap code inspires me to do my own better. I inherited a colleagues work after she left, and it was horrible. But I thought about why it was horrible, and how to make it better. What would it look like if it was done well? Even with my own code, if I look at something I did 6 months ago, and it doesn't make sense…
It frightens me how my future replacement is probably going to think "gee, that guy was horrible" unless he knows all the historic context and reasons why the code was written the way it was written.
That's what comments are for :) It's not only about your future replacement, it's also about your future self.