It's clear that allowing high-skilled tech workers to immigrate to the United States is a boon to the engineers themselves, who experience a fivefold increase in earnings. It's also clear from the furious lobbying around it that it's a boon to U.S.-based technology firms. Given that, it's simple for a tech worker program to be structured as revenue-positive and growth-enhancing and it's clear that an influx of skilled workers into a community is going to be helpful to the financial interests of local service providers—restaurateurs, dentists, barbers, plumbers—who'll sell services to the new residents. So even though critics fear that more skilled immigration "is a ruse for lowering wages," I think it's a no-brainer that we should do it. Purely among domestic workers, the winners outnumber the potential losers, and the interests of the immigrants count.
But is an influx of foreign-born engineers bad for the earnings power of native-born engineers? I don't think it's obvious. Suppose the city of San Francisco deported 10 percent of its computer programmers tomorrow and adopted a law saying that in the future no engineers born in other counties were allowed to move here. Would that lead to skyrocketing earnings for the remaining engineers? I seriously doubt it. I think it would destroy the San Francisco tech industry with some unfortunate knock-on effects a bit south in Silicon Valley. Since no other county in America would be so crazy as to adopt such a law, at the end of the day San Francisco's engineers would do all right. The big tech employers here would move, startups would stop launching here, and in the long term everyone would make plenty of money. But it would be an extremely curious way of improving the welfare of the incumbent population of San Francisco engineers.
In general in the immigration context, it's helpful to ask yourself, "What about domestic migration?" I've never heard of an American city coming up with the idea that it should try to discourage highly skilled Americans from moving there. If anything, cities go out of their way to try to be appealing places for skilled workers to move. So why would keeping foreigners out be smart?