A 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 common law and civil law systems, their usage is different. In a civil law country, a Code typically exhaustively covers the complete system of law. By contrast, in a common law country a Code 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. By contrast, a code entirely replaces the common law in a particular area, leaving the common law inoperative unless and until the code is repealed.
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 amongst 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 codes did not exhaustively describe the Roman legal system. The Twelve Tables were limited in scope, and most legal doctrines were developed by the pontificates, 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. However, it was authoritative only in the Eastern Roman Empire, and never became a contemporary legal tradition in the West.
In ancient China, the first comprehensive criminal code was the Tang Code, created in 624 AD in the Tang Dynasty. This, and subsequent imperial codes, formed the basis for the penal system of both China and other East Asian states under its cultural influence. The last and best preserved imperial code is the Great Qing Legal Code, created in 1644 upon the founding of the Qing Dynasty. This code was the exclusive and exhaustive statement of Chinese law between 1644 and 1912. Though it was in form a criminal code, large parts of the code dealt with civil law matters and the settlement of civil disputes. The Code ceased its operation upon the fall of the Qing dynasty in 1912, but significant provisions remained in operation in Hong Kong until well into the 1970s due to a peculiar interaction between it and the British common law system.
In Europe, Roman law, especially the Corpus Juris Civilis, became the basis of the legal systems of many countries. Roman law was either adopted by legislation (becoming positive law), or through processing by jurists. The accepted Roman law is usually then codified and forms part of the central Code. The codification movement gathered pace after the rise of nation-states after the Treaty of Westphalia. Prominent national civil codes include the Napoleonic Code (code civil) of 1804, the German civil code (Bürgerliches Gesetzbuch) of 1900 and the Swiss codes.
Meanwhile, African civilizations developed their own legal traditions, sometimes codifying them through consistent oral tradition, as illustrated e.g. by the Kouroukan Fouga, a charter proclaimed by the Mali Empire in 1222-1236, enumerating regulations in both constitutional and civil matters, and transmitted to this day by griots under oath.
The Continental civil law tradition spread around the world along with European cultural and military dominance in recent centuries. During the Meiji Restoration, Japan adopted a new Civil Code (1898), based primarily on the French civil code and influenced by the German code. After the Xinhai Revolution of 1911 in China, the new Republic of China government abandoned the imperial code tradition and instead adopted a new civil code strongly influenced by the German Bürgerliches Gesetzbuch, and also influenced by the Japanese code. This new tradition has been largely maintained in the legal system of the People's Republic of China since 1949.
Meanwhile, codifications also became more common in common law systems. For example, a criminal code is found in a number of common law jurisdictions in Australia and the Americas, and continues to be debated in England.
In the Americas, the influence of Continental legal codes has manifest itself in two ways. In civil law jurisdictions, legal codes in the Continental tradition are common. In common law jurisdictions, however, there has been a strong trend towards codification. The result of such codification, however, is not always a legal code as found in civil law jurisdictions. For example, the California Civil Code largely codifies common law doctrine and is very different in form and content from all other civil codes.
A civil code typically forms the core of civil law systems. The legal Code typically covers exhaustively the entire system of private law.
Civil codes are sometimes also found in common law systems, especially in the United States of America. However, such civil codes are often collections of common law rules and a variety of ad hoc statutes; that is, they do not aspire to complete logical coherence.
The concept of codification dates back to ancient Babylon. The earliest surviving civil code is the Code of Hammurabi, produced circa 1760 BC by the Babylonian king Hammurabi. The most famous ancient civil code, however, is the Corpus Juris Civilis, a codification of Roman law produced between 529-534 AD by the Byzantine emperor Justinian I, which forms the basis of civil law legal systems.
Other civil codes used since ancient times include various texts used in religious laws, such as the Law of Manu in Hindu law, the Mishnah in Jewish Halakha law, the Canons of the Apostles in Christian Canon law, and arguably the Qur'an and Sunnah in Islamic Sharia law to some extent.
A criminal code or penal code is a common feature in many legal systems. Codification of the criminal law allows the criminal law to be more accessible and more democratically made and amended.
Title 18 of the United States Code is the criminal and penal code of the federal government of the United States. It deals with federal crimes and criminal procedure.