Knuth suggests, in TAOCP, that the best way to write a program is to write it once, scrap it completely and rewrite from scratch. Very much in line with spending an entire semester making one perfect program vs spending a semester writing and rewriting new programs from scratch.