It's interesting to me that this idea of "engagement is king" took root with anyone, let alone programming writers. It seems very wrong to me, but you can let me know if my logic makes sense.
Looking at people's stats, I think engagement only looks like a big factor for articles that we can't find an audience for, i.e. less than 100 member reads. So then, yeah, engagement can be the difference between $2 and $1.
But isn't this obviously a local maxima? The king for getting paid is distribution and that's where programmers have a huge advantage over the entire platform. There is a huge audience of programmers on Medium and, frankly, most programming authors are not competing for the boost. Instead, we see a lot of competition for one-off Google search results.
But maybe that actually is the king of compensation, because I have a hard time imagining that Medium will ever pay a programmer to write as much as businesses pay programmers to program. If that's true for you, then the reason to write on Medium is SEO. You don't even need to put stuff behind the paywall. That might even be counter productive for you.
I tend to think this last way about writing as a portfolio. If I were still a working programmer, I'd be focusing on writing that will impress my next employer.