A legal code is a moral code enforced by the law of a state. It implies an ethical code of court procedures and evidence rules that apply to jurists, i.e. to judges and lawyers. In its most general form a legal code is a compact restatement of the law that is designed to be clear, understandable by the lay person (one without a legal education). Legal codes can be of a general private law nature, or they may cover specific areas of law such as in the area of criminal law or certain kinds of statutory types of laws, i.e. traffic code.
Usually, the legal code serves the dual purpose of broadcasting a certain idea of public morality, and disclosing the retribution that the society, via the state, will visit on those who offend that morality.
For further predictability, a legal code usually includes a body of prior decisions or precedent, which with the law itself constitutes what is called a jurisprudence. A jurist is an individual who makes judgements that are incorporated into the jurisprudence, either as cases or as laws themselves.
To speed cases along and ensure uniform representation, many legal codes require a defendant or plaintiff to be represented by an attorney at law, whose responsibility is to take the client's case without prejudice, and to their best to minimize the penalties applied by law, including ideally the release of their client from any responsibility at all.
Example legal codes that rely heavily on precedent and the opinions of prior jurists include English common law and U.S. Constitutional Law. By contrast most implementations of Islamic Shariah. Napoleonic Code, Chinese Law and German Law, emphasize very specific philosophical principles rooted in Islam, French, Chinese, and German philosophy respectively - the role of precedent and prior jurists is much reduced and that of current judges enhanced - thus these can be seen as an ethical code which applies to the jurists themselves.
If a legal system is not controlled by a single institution, the legal code typically includes ways to balance the power of different participants (sometimes known as checks and balances). These measures can reduce the potential for one group of participants to develop a monopoly over the legal system. For example, in a representative democracy, it may be required that elected officials make or vote on any changes to the law.
See also: attorney at law, jurist, ethical code, moral code, civil code