Coaches are not involved in hierarchical relationship where they could fire you or make your life hell. Neither they are involved in the decision of how much you should earn or if you should be promoted or not.
So those are absolutely different sorts of relationships. The coach is not your superior so it changes everything about what they could say to you and the consequences it could have on you.
So no, a good manager should never say stuff like that. It's the sort of words that can be the involuntary sparkle which could ignite depression or even suicide. And for what ? A better performance at writing crud programs ? No. Professional things are not important enough to say any of this.