The fact that he was a foreigner provides a hint. It seems there's a general fear in the US of foreign workers taking the jobs of citizens. I wonder, is it not possible to switch employers when you have a work visa?
there's a general fear in the US of foreign workers taking the jobs of citizens
Comments from our idiot president and his ilk aside, there is not. I'm willing to entertain discussions to the contrary, but this is far from my experience either here in the Midwest, or on the East Coast where I previously worked.
I worked for the US counter part of an Indian company in Illinois for a couple of years. We used to have town hall meetings every quarter. On 2 such meetings, I heard two separate American employees questioning the speaker about outsourcing more. He would be talking about how they are planning to spread out a project with 20% in US, 50% in India, remaining in Europe and some other place. In both the occasions, they asked questions that meant why only 20% in US or something similar. He always replied that's what the customer is willing to pay, that the customer has so and so budget, and this is how we are meeting it.
Or maybe more realistic and less paranoid: the code he wrote was more performant but significantly less maintainable. Look at it from a director's perspective. Technical debt from an H1b. Is he trying to maintain job security by being the only one who understands how a critical module works?
You seem to have jumped to a conclusion rather quickly.
Even assuming for a second that the hysteria was because the new function that GP wrote is complex, wouldn't the reaction to that would've been "Can you write it more clearly?" instead of the hysteria and pariah ceremony?
In this scenario the lack of performance was significant, so I would say it was necessary. If performance was adequate, different story.
For example. We have a redux based content editor that is quite slow. It is however more than performant enough for the use case. I would love it if someone refactored it though...
You don't know how significant the performance difference was. You're just believing the commenter who thought it was without hearing from the company who obviously didn't think it was a priority.