It's unlikely that the person making the comment is out to harm or anger you. Ideally you are both on the same team, trying to perform some task for the benefit of your employer. In that case, recognize that your ego or pride has been engaged; observe it, but then put it aside and get back to work.
If they ARE actively trying to anger your or harm your career (rare, but some people are just toxic) all the more reason to ignore the provocation.
My main challenge is when people dig in their heels about technical solutions that I find distasteful. For me that's less about how beautiful the code is and more whether it solves the problem and will be maintainable. Even here a lot of arguments can be ignored. Again, make your ego and identity as small as possible. Brace style? Tabs vs spaces? I honestly don't care. If someone wants to argue about those things I'm happy to let them win.
Be half-monk, half-hitman and get the job done.