The first writing is almost always a throw away, you should expect it and accept it, it will be significantly better the second time around. Once you build the code once, you have learned 90% of what was wrong with the design. A large rewrite at that point will pay off exponentially down the road.
Source (the jump to that post doesn't seem to work in IE, use Firefox :-)
This is very true, and my burning of an old codebase is very overdue. Damn the fact that it works just enough to not make it as a priority item... Anyway, I'm pretty sure this should be considered the coding equivalent of drafts of a document.