I prefer the version attributed to Aristotle: "Those who can, do; those who understand, teach"
A good teacher needs a deep understanding of their topic, often deeper that that required to be a do-er only.
I really enjoy the somewhat sarcastic retort. Those who can’t teach: don’t.
I hate that phrase. There are billions of people who can't code and also aren't teaching it. And plenty of people who are good at something and enjoy giving back and sharing in the form of teaching.