Everyone has ego accepting it just the first stage. Its hard to take comments from anyone on your beautifully written code, as the quote goes...
Beauty is in the eye of the beholder
Its human nature to have it nothing wrong with it. There are 8 billion perspectives so is the population.
When a developer writes code he would mostly want cover as many scenarios there is, being human is our only limitation for now 😉.
We get so involved writing to those limited perspectives we can imagine, that it hurts when someone points out the missed ones. Only thing that teaches to take in criticism is experience.
Don't worry about the ego it fades with time 😇
Photo by Charles Deluvio