Always believe that your code is a piece of crap.
This is why you will keep improving. You never become good, you are eternal student.
As soon as you will say to yourself how good you are, you will stop learning.
Never say or think how bad or good you are. Just keep doing ACTION. Keep practicing, keep developing habits. Real world results of your actions and how people use them determines how good or bad you are, not what you think about yourself or what other people say.
The most interesting part of this approach is that you always will be 100% honest with yourself and others even when your code really will be piece of crap.