Rules of Programming: Learn From Your Mistakes
It's ok to do mistakes, as long as you learn from your mistakes. Speak to other developers to learn about their mistakes. That way, you hopefully don't have to repeat those mistakes.
Forums and Q&A sites like stackoverflow are great aid here. Going back to some of your previous projects might help you too.
Rule #20 of programming:
Learn from your mistakes