Have you ever had this feeling that your code is bad, the whole project is a mess, and you just want to step off? On your daily job you can explain this feeling away with your coworkers, asshole boss, or something like this. But with side/pet projects there is really no excuse.
For example I'm currently maintaining my Firefox extension - fixing bugs and adding new features. Quite frequently when I go back to the code written months ago the feelings that arise inside me are quite controversial - "Did I write that? Really??" Knowing that proper implementation of new feature "the right way" requires throwing away whole module and still putting together a quick hack - sometimes I don't even hesitate.
As the project grows, features are added there remains less and less room for refactoring...
Do you have any recipes for dealing with this kind of emotional state? Do you just pull yourself together and give the whole project another thought, rewrite version 2? Or maybe just ignore all this - "working code is better than perfect code"?