I draft designs in my head, then in code. Sometimes in parallel. I know academics say this is wrong and I should get out a pen and paper, but I don't trust academics. Qt allows me to prototype very quickly. Once I can see how the design is panning out, I usually scrap everything and write from scratch.
Programming is like cooking.
If you add too much pepper, you can't really cover it up. Best to just start again and remember your mistake next time. Sketching out a design in code, using stubs and scaffolding to see how the less important parts will fit in the the whole, gives you a good idea of what the finished system should be like. I don't like code being used until I consider it perfect, so many times I will simply scrap an idea because I haven't found an elegant solution yet. A few weeks later I might have come up with some new ideas about design and find that they solve the problem I put away.