But first a word about words.
Some (especially academics) want to say that the words ethics and morals express different ideas, thoughts. Maybe to them, not to me. To me they are synonyms. I will use either depending on what I think/feel is the most appropriate in the context.
Name me an organization that does not have a Code of Ethics, Code of Conduct, Code of Practice, Code of Behaviour. Which do you have, what does your organization have? All, some, none?
Some think these are synonyms: they are not. Some put them in regulations, procedures, policy statements, or (horror!) in legislation.
Most of what I say below is applicable to both individuals and groups (organizations, teams, branches, departments, companies). Where there are differences I will try to make that clear.
Here are what I think they are.
Code of Ethics
A code of ethics is a statement of values, moral/ethical values. To me they are foundational, functional statements. Not merely aspirational, living documents to be expressions of the commonly held values of every group member. Any statements of mission or purpose must be consistent with it.
As I believe that a code of ethics for a group is meaningful only in the context of agreed values and adhered to because and only because all believe in the values and voluntarily follow the code.
It follows from this that any attempt to legalize a code of ethics renders it null and void. It becomes legislation, law with consequences for violations. It is now difficult to know if a member of the group follows the code because it is the right thing to do or because they want to avoid the consequences.
According to Beyerstein (1996, Function and Limitations of Professional Codes of Ethics, in Applied ethics: a reader) a code serves four functions: guidance, agreed standards, public pronouncement, and informs other groups about what to expect from this group. Out of these functions comes the guiding principle for constructing a Code of Ethics: consensus.
Unfortunately most codes of ethics are not reached by consensus; they are imposed. Sometimes they are formulated by a panel of well intentioned experts (PoE), engaged specifically to construct the code. Sometimes the PoE interviews a (representative) sample of the group (especially if the group is large) and distills common themes. As inclusive as this appears, it is nothing like a consensus of all in the group.
There are three aspects of having and using a Code of Ethics:
Code of Conduct
These ought to be documents that tell people the what (and sometimes the how) of acceptable actions. Frequently some confuse it with a code of ethics, thinking they are the same thing: they are not. Codes of ethics do not say what to do or how to do it.
Code of Practice
These ought to be documents that tell people what the acceptable ways of doing things are. Frequently some confuse it with a code of ethics, thinking they are the same thing: they are not. Codes of ethics do not say how to do it.
Code of Behaviour
These ought to be rules about how to behave. Again sometimes confused with codes of ethics. Codes of ethics do not say how to behave.