If they are smart, they should: right now they have a lot of power in the workplace because there is demand for them. This is a problem tech business owners have identified: programmers have too much power on the job relative to their bosses. They require good wages, they require too many benefits, they complain and sue when they are sexually harassed, they demand equity and to be treated well and refuse to accept the company asserting total ownership of their person in their contract, like non competes, binding arbitration, corporate ownership of every thought they have on the job or off. Could you imagine a company tracking every movement of every programmer at all times and automatically firing those who fail to "perform" according to certain metric? Does your eye linger too long on a comment relative to your peers? Fired. Did it take you too long to write this method this one time? Fired. This is the reality for Amazon warehouse workers and it could be for you, easily.
But there is a solution (from the prospective of employers) for this "problem": every time you hear someone talk about "teaching everyone to code" or "the STEM shortage" (which absolutely does not exist -- there is a shortage of qualified programmers willing to work for $12/hr, a shortage of hard science PhDs willing to do menial lab work for 10$/hr) this is coded language for "let's make millions more programmers so that they become so commonplace they become a commodity and may be treated as such". As it turns out, programming is not that hard, anyone could do it if they learned. And they are learning.
Programmers would be smart to unionize before this strategy succeeds, not after, it will be much easier while they still have power. But this requires social and political intelligence, and for programmers (who lean Libertarian up until the moment they get laid off or abused by their boss) to put their egos aside and disabuse themselves of the notion that they succeeded only because they are so much more brilliant than everyone else.