in reply to What to do when you realize you've written bad code

We all make mistakes. With time and experience you will learn to anticipate and correct them before you even make them; but that doesn't happen overnight. No baby learns to walk without falling many a time.

It is definitely a step you should be proud of to be unsatisfied with your own code. Much as it dismays you now that you've written awful code, the fact that you did and that you also recognized it means you have the necessary frame of mind to grow.

I started into Perl with CGI scripts, and looking back I have to say, golly, were they ugly. I made all the typical mistakes (no strict (but warnings!), handrolled CGI parser, tons of ugly verbose code, everything). But it was a necessary step in the process.

Don't beat yourself up over it. If it doesn't look doable cleanly now, do it as you can, and think back to it in a few months - I bet you'll say "duh! I could have this and that." We learn continuously.

Two articles you may want to read: Teach yourself programming in Ten Years for the human side and Big Ball of Mud for the technical one.

Makeshifts last the longest.

  • Comment on Re: What to do when you realize you've written bad code