Those of you with a membership in ACM or IEEE, I'm interested in hearing your thoughts on why you do. Those of you who don't, would you consider pledging yourself to a code of ethics if they met your requirements? What would those requirements be?
If it were possible to commit programmers to a code of ethics, it would be possible to do what most professions do an organize to protect the careers and incomes of professionals. On top of the code of ethics would soon be refusing to work on any team with H1-Bs, just as doctors, lawyers, and accountants don't work with any peers who haven't passed the same qualification hurdles as they have. I don't like the idea of…
Your argument that other professions do it is invalid. In fact the government should be more proactive in ensuring that professions only impose valid conditions on employment, and don't add spurious requirements in order to exclude people from the profession, in order to, as you say "protect [their] careers and incomes".