I used to be the same way, but I've intentionally changed myself to fix it.
First, I don't treat my code as an extension of myself. My code is not me, and criticism of my code is not criticism of me.
I love a good solution, and I write good solutions, but all things created by humans are flawed, and therefore everything I make will be flawed. If somebody sees something I didn't, it's not because they're necessarily better than me (though they may be), but they have a different perspective. Often, it's something I would have seen if I was in their position and not so close to the code myself.
And because of this love for a good solution, I've trained myself to have a love for good criticism. Every piece of criticism is an opportunity. You are not perfect. You have room to grow and always will. Criticism is potentially a door to this room for growth.
Just internalize the mantra of self improvement. "I was wrong" is a wonderful thing. It means the same thing as "next time, I will be right".
First, I don't treat my code as an extension of myself. My code is not me, and criticism of my code is not criticism of me.
I love a good solution, and I write good solutions, but all things created by humans are flawed, and therefore everything I make will be flawed. If somebody sees something I didn't, it's not because they're necessarily better than me (though they may be), but they have a different perspective. Often, it's something I would have seen if I was in their position and not so close to the code myself.
And because of this love for a good solution, I've trained myself to have a love for good criticism. Every piece of criticism is an opportunity. You are not perfect. You have room to grow and always will. Criticism is potentially a door to this room for growth.
Just internalize the mantra of self improvement. "I was wrong" is a wonderful thing. It means the same thing as "next time, I will be right".