Here's a good post from Tyler Cowen on the STEM worker "shortage" issue that features a good analogy: "it could have been pointed out that, before the rise of Hyundai, South Korea had just the right number of auto workers (not many) for their factories (also not many)."
This also highlights the biggest problem with the H1-B skilled guest worker program, which isn't that more skilled technology workers moving here is bad but that structuring it as a guest-worker program is a lot worse than handing out more green cards to similar people would be. There's a strong case for guest workers in something seasonal like agriculture, or even something highly cyclical like construction. But one important goal of bringing skilled STEM workers into the United States is to build upon and expand in our leadership in the high-tech realm. To that end, it makes much more sense to encouraged skilled workers to settle here than to come and go. Instead of working for the United States for a few years and then going back home, we should want people to work in the United States for a few years and then maybe found their own company. Or go work for some other company. Restricting them to guest worker status is convenient for their initial employers, but it undermines much of the sound rationale for importing skilled workers.
The entire debate over the H-1B program is multi-faceted, and I think it's important to keep that clearly on the table. I have a lot of problems with the way it's structured. But it's not always obvious what critics are trying to propose as their implicit alternative. Giving out fewer H1-B visas is, I think, worse than giving out more. But replacing STEM guest workers with STEM permanent residents would be a change for the better.