And that doesn't mean there won't be a huge discontinuity where demand for "good programmers" is massively outstripped by supply. Ask for example someone who lived through the dot com crash.
"companies actually need to function and be productive"
Read up on Pournelle's iron law of bureaucracy and more generally the agent principal problem. Managers of a long enough established company aren't generally interested in it being able to "function and be productive," but their own position in it.
Plenty are also sociopaths. They are known to pull stunts like firing the very most "actually capable" person and telling the survivors of a layoff that this shows no one is safe. Even if their policies like this actually kill the company.
I've seen that at ones small and once _huge,_ and this also coupled with the H-1B game as @amerika@fsebugoutzone.org noted in his reply. See also what happens when a pajeet becomes a manager....
(Seriously, if one becomes your manager, or on up the ladder, start looking for another job ___immediately.___ Even if they keep you, they'll treat you with absolute callousness. You aren't part of their jati, are probably below them in caste (for example lots of Brahmans are here because of overt discrimination against them in India) and you aren't really human to them. And this is combined with things like izzat.)
Also run away from any company that introduces stack ranking. Microsoft traded the latter for a pajeet CEO
Amazon's probably the most prominent one still doing that; you might have been hired just so you could be fired to meet a quota. See also Google using that for promotions.
See also the terrible age discrimination which cuts directly against creating "good programmers." Prepare for job hunts to start getting very difficult when you're around thirty five, and worse in the US when you hit or are closer to forty.
There's lots and lots more; number one, network like crazy.
https://en.wikipedia.org/wiki/Jerry_Pournelle#Pournelle's_iron_law_of_bureaucracy
https://en.wikipedia.org/wiki/Principal%E2%80%93agent_problem