I feel that the self-confidence that is important is not in regards to specific coding skill or the quality of the code itself, but rather the confidence that no matter how the project goes I will be able to find a way through the problems. It may not involve the greatest method of solving it, and I'll probably be able to look back with hindsight and learn a lot, but one way or another I'll be able to see it through.
To me that mindset is very different from thinking that every piece of code I write is particularly amazing, it just helps free me from some of the paralysis of worrying about going down dead-ends.