Would that everyone thought more carefully (or knew how to) about our code, potential longevity, of course the commenting and cleanup of hacks and old bugs as you mentioned and knew what risks legacy issues can cause! It's at subject for at least a book, a talk, and courseware!