When someone gives you a complement to your face, or via chat, or even in pull requests it feels good. If it’s a complement aligned with your values it could give you a boost for a long time.
If the complement is unexpected or about something you are self conscious about it may make you feel worse; even if the other person intends it for good.
Some of the best complements are the ones people say behind your back. They praise your work to someone else. They ask to be on a project with you, or say something like “they’re great” in passing.
You don’t get the immediate lift, but you also avoid the potential down. Complements behind your back are the best for your long term happiness and success.