Ethical codes are adopted by organizations to assist members in understanding the difference between right and wrong and in applying that understanding to their decisions. An ethical code generally implies documents at three levels: codes of business ethics, codes of conduct for employees, and codes of professional practice.
They are distinct from moral codes that may apply to the culture, education, and religion of a whole society. It is debated whether the politicians should apply a code of ethics, or whether it is a profession entirely discretionary, just subject to compliance with the law: however, recently codes of practice have been approved in this field.
Often, acts that violate ethical codes may also violate a law or regulation and can be punishable at law or by government agency remedies.
Even organizations and communities that may be considered criminal in nature may have ethical codes of conduct, official or unofficial. Examples could include hacker communities, bands of thieves, and street gangs.
Codes seek to define and delineate the difference between conduct and behavior that is malum in se, malum prohibitum, and good practice. Sometimes ethical codes include sections that are meant to give firm rules, but some offer general guidance, and sometimes the words are merely aspirational.
In sum, a code of ethics is an attempt to codify "good and bad behavior".