I'm sure this happens to many people: you sit down to go over some code you've written some time ago. I'm not talking 15 years ago, merely a couple of years back. And you say - "damn, this can be done so much better".

This happens to me all the time ! I've even had a "cascade" of such thoughts. A couple of years ago I improved some C++ code of mine from even earlier that sucked badly. I recall being appalled at the quality of that code, and rewriting major chunks of it. This week I'm looking at this code again, and it looks bad, again ! Just what I rewrote two years ago !

It happened today again, with a Perl program I wrote just a year and a half ago. Looking at the code I understood that it's lacking in many aspects and can be made much better. I spent most of yesterday and today's morning to refactor it into a much better shape.

I have a creeping feeling, though, that looking at this code some time in the future, I'll *again* think it's bad.

On one hand, this is probably good because it means I'm in a state of constant improvement. On the other hand, it shakes my confidence in my current code. How will I have the hutzpah to show my code to someone when I'm not confident it's good ? Can I only show code I wrote less than a month ago ?