In spite of their best efforts, most of the software development still occurs in the US. Think Microsoft hasn't tried to offshore as much as possible to India and China, building dev centers there? Or Google and FB?
Even then, just look at what kind of workers end up being imported through this programs. Not always the best and brightest. Many do entry level jobs not even in software development, for outsourcing companies.
I'm not saying outright ban immigration but better control is needed. (And saying this as a non-American living in the US). Something that struck me as particularly interesting and President Trump recently commented, is how about making companies bid for a fixed number of visa slots. Whoever pays the highest salary, gets the visa. This would certainly make companies be able to bring the brightest, while raising wages in general.