Ask me what is the programmer's most vicious enemy and I will answer: his own ego. Let's see some examples.
You've written a messy code, someone more experienced told you so, but you've spent so much time working on it, therefore you might say something like “Aw c'mon, it's not that bad” while your ego deep down is shouting “WTF? It's the most clever code in the known universe, I'm a natural and you just don't get it!”
The fact is, you wrote a messy code, and the more experienced colleague has pointed it out probably just because he wants you to improve, so the best thing you can do is to say “Thank you” and actually be glad someone took the effort to help you recognize your own mistakes, thus learn from them.
Second example. You've been programming for let's say 5+ years, you finally start to feel pretty confident, maybe you finally got rid of impostor syndrome, and suddenly someone refers to of you as a "beginner" or "junior" – a cold shower for your ego that is now shouting something like “Hey, I'm a pro. Don't you see it?” and you totally miss the opportunity that has just opened in front of you.
Think again, if someone considers you less knowledgeable and skillful than you actually are, the bar has been set pretty low for you and now you could make a good impression with not much of an extra effort.
Imagine the opposite way, someone considers you being a superstar ninja-guru mastermind and then you show a mediocre work. In such a case, though the work itself wouldn't be explicitly bad, it probably will arouse disappointment.
Plus, being egocentric and taking things personally could literally destroy you, mentally, socially and eventually physically and I think it's good to be aware of that.