It should really be the Code of Marduk, of course. Just look at the bas-relief sculpture at the top of the stele:

American Historical Association.
According to people more informed than I am, King Hammurabi (ruled in Babylon, in Mesopotamia, in the early 18th century BC) is the one standing in the posture of respect to the god, who is sitting, holding a symbol of authority, and telling the king which the laws he wants instituted. The classic comparison here is Moses atop Mount Sinai getting instruction from Yahweh; in both cases we see how religion helps to justify the system. These laws aren’t arbitrary! Some human, as important as he was, didn’t just make them up on the toilet one morning. They come from a god, so you’d better obey them.
The two notable features of the Code of Hammurabi are retributive justice (“an eye for an eye”), and differentiated punishment, based on one’s social status. Generally, if you harm a social equal, you suffer the same harm back, but if you harm someone beneath you in the social hierarchy (that is, if you’re an aristocrat and you hurt a commoner, or if you’re a commoner and you hurt a slave), you can always pay a fine and get out of being hurt yourself.* Nowadays we’re appalled by this, of course: as the bumper sticker says, “an eye for an eye leaves everyone blind!” And really, if someone harmed me, I wouldn’t be satisfied by getting to inflict the same harm on him – I’d much rather have some cold hard cash for compensation instead. But I have a theory about the lex talionis. That is, nowadays murder, assault, battery, grievous bodily harm, etc. are all crimes – crimes against the state, whose subjects have been harmed and whose peace has been disturbed. Thus does the state reserve for itself the right to punish such actions. This wasn’t always the case – in many other times and places hurting someone was something between you and him – or more accurately, between your people and his people. The state was much more self-interested and self-preservative. Harming someone else was like putting up a fence three feet beyond your actual property line and trying to claim a bit of your neighbor’s yard. This is not something he can call the police about, and it’s not something that anyone will even enforce save for him complaining about it. Violent revenge, in other times and places, was legitimate in a way that it is not in the present-day United States. What retributive justice did, therefore, is to impose a ceiling on the amount of revenge you could take. It’s an eye for an eye – not two eyes, seven teeth, and an ear. It is natural to escalate, to inflict far more suffering than you have suffered, but even ancient states had an interest in stopping such cycles of violence. Thus the proportional (and limited) violence allowed.
* As far as the formal laws were concerned, of course. We have no idea whether these laws were actually enforced, or merely rhetorical. (Nevertheless, laws remain a good historical source for a given society, because no one passes a law against something that isn’t happening.)
Some of my favorite laws from the Code of Hammurabi:
2. If any one bring an accusation against a man, and the accused go to the river and leap into the river, if he sink in the river his accuser shall take possession of his house. But if the river prove that the accused is not guilty, and he escape unhurt, then he who had brought the accusation shall be put to death, while he who leaped into the river shall take possession of the house that had belonged to his accuser.
This is a wonderful description of trial by ordeal. The river knows! But don’t make your accusation lightly (the stakes are a little higher here than losing a civil suit and having to pay your opponent’s court costs, as is the case in Canada.)
I hope that enterprising Babylonians taught themselves how to swim.
53. If any one be too lazy to keep his dam in proper condition, and does not so keep it; if then the dam break and all the fields be flooded, then shall he in whose dam the break occurred be sold for money, and the money shall replace the corn which he has caused to be ruined.
Agriculture was dependent on irrigation – but everyone had to pull together to make sure that it worked.
57. If a shepherd, without the permission of the owner of the field, and without the knowledge of the owner of the sheep, lets the sheep into a field to graze, then the owner of the field shall harvest his crop, and the shepherd, who had pastured his flock there without permission of the owner of the field, shall pay to the owner twenty gur of corn for every ten gan.
Oh, the farmer and the shepherd should be friends! It’s interesting how you either raised crops or you raised animals – rarely did people do both. It’s also interesting how raising crops seems to be the more important activity here – in contrast to ancient Hebrew society, which seemed to favor pastoralism (viz. the gifts of Cain and Abel in Genesis).
104. If a merchant give an agent corn, wool, oil, or any other goods to transport, the agent shall give a receipt for the amount, and compensate the merchant therefor. Then he shall obtain a receipt from the merchant for the money that he gives the merchant.
Here we see evidence of long-distance trade carried out by merchants and their employees – and the perennial temptation to cheat.
108. If a tavern-keeper (feminine) does not accept corn according to gross weight in payment of drink, but takes money, and the price of the drink is less than that of the corn, she shall be convicted and thrown into the water.
110. If a “sister of a god” open a tavern, or enter a tavern to drink, then shall this woman be burned to death.
Then as now bars were disreputable places. They watered down the liquor! They were so bad otherwise that the Babylonian equivalent of nuns were forbidden to enter them. I wonder if they weren’t associated with prostitution, with the feminine tavern-keeper playing the role of the madam.
142. If a woman quarrel with her husband, and say: “You are not congenial to me,” the reasons for her prejudice must be presented. If she is guiltless, and there is no fault on her part, but he leaves and neglects her, then no guilt attaches to this woman, she shall take her dowry and go back to her father’s house.
It’s definitely a man’s world in ancient Babylon, but I like how women have some rights. Here, she can actually initiate divorce, and as long as she is “guiltless,” she can leave.
215. If a physician make a large incision with an operating knife and cure it, or if he open a tumor (over the eye) with an operating knife, and saves the eye, he shall receive ten shekels in money.
218. If a physician make a large incision with the operating knife, and kill him, or open a tumor with the operating knife, and cut out the eye, his hands shall be cut off.
So Babylon had professional physicians. I wonder if the ten shekels was a floor or a ceiling – that is, was it an especially generous reward for competence, or was it a maximum, to prevent the greedy physician from charging even more? Note that you were punished exceedingly if you failed. That’s just the way it is in the Code of Hammurabi!