A code of law, also called a law code or legal code, is a type of legislation that purports to exhaustively cover a complete system of laws or a particular area of law as it existed at the time the code was enacted, by a process of codification. Though the process and motivations for codification are similar in different common law and civil law systems, their usage is different.
In a civil law country, a code of law typically exhaustively covers the complete system of law, such as civil law or criminal law. By contrast, in a common law country with legislative practices in the English tradition, a code of law is a less common form of legislation, which differs from usual legislation that, when enacted, modify the existing common law only to the extent of its express or implicit provision, but otherwise leaves the common law intact. A code entirely replaces the common law in a particular area, leaving the common law inoperative unless and until the code is repealed. In a third case of slightly different usage, in the United States and other common law countries that have adopted similar legislative practices, a code of law is a standing body of statute law on a particular area, which is added to, subtracted from, or otherwise modified by individual legislative enactments.
The legal code was a common feature of the legal systems of the ancient Middle East. The Sumerian Code of Ur-Nammu (c. 2100-2050 BC), then the Babylonian Code of Hammurabi (c. 1760 BC), are among the earliest and best preserved legal codes, originating in the Fertile Crescent.
In the Roman empire, a number of codifications were developed, such as the Twelve Tables of Roman law (first compiled in 450 BC) and the Corpus Juris Civilis of Justinian, also known as the Justinian Code (429 - 534 AD). However, these law codes did not exhaustively describe the Roman legal system. The Twelve Tables were limited in scope, and most legal doctrines were developed by the pontifices, who "interpreted" the tables to deal with situations far beyond what is contained therein. The Justinian Code collected together existing legal material at the time.