I have decided to rewrite a badly written program of mine (A Good Thing). The main reason it was so badlywritten was that I did not fully plan out how the program would work. I hacked together a system for reading data, and created all of the algorithms on the fly (A Bad Thing). Here is my question, does anybody know of some good techniques to plan out code? Which ones work, and which don't?