I suppose there's a difference between when you're working with someone versus showing off to other people. If I'm doing a Show HN or I email a friend to check something out, sure I love flattery and compliments as anyone. It's within the technical scope of working together that I find it obnoxious.
And it's not really self confidence[1]. It's more of an extension of principles of coding. Anyone can write a system that does X. But doing X when things go well, and doing it in the face of errors, edge cases, and other faults - that's what it's all about. For me, anyways, when I'm writing code "as an engineer". So I don't find it particularly notable that something works. Of course it " works ", or you wouldn't be telling or showing me in the first place! Likewise if I ask for a review and your only comment is " file buffer is too small " I'm gonna guess the rest is alright else you wouldn't bother pointing out smaller things. If I'm unsure about something, I'll ask about it explicitly.
Outside of a feedback system like a code review, it is important to let people know you appreciate their work. And it's to my detriment that I don't let people know, honestly, when I appreciate them. But that's separate from mixing it in with criticism.
1: I've low confidence in my self confidence. On one hand I know I have a fairly good error rate and I'm objectively better than a lot of other developers. Yet, especially here on HN, I can plainly see I'm nothing special. But this doesn't really assure me that any particular piece of my work is good.