>Think about how we program. We are given requirements and we noodle about it for a bit and start writing some code that is nowhere close to what the final source will be.
That's exactly how I do it. Play around with the problem, and once I've messed with it a bit, take a step back and plan out the right way to do it. Sometimes my "proof of concept" doodling will have salvageable bits. Very rarely (or if it was an easy requirement) the play code will be close to ready. Sometimes, I have to throw it all away. Such is life.