It seems odd for pirates to have rules. After all, are they not the lawless ones, the enemies to all nations? Yet pirates need to keep order among themselves, if they are to cooperate successfully in the taking and plundering of other ships, as well as managing their own ships.

In the third “Pirates of the Caribbean” film, Keith Richards gets to play the keeper of the pirate code
The pirates of the “Golden Age of Piracy” (roughly 1713 – 1730) took as their model the articles apprentices signed when they joined a profession. It is these articles that describe the pirates’ codes of conducts. We have at least four examples of pirate articles adopted by crews during the Golden Age, specifically between 1721 and 1724: those of Capt. “Black Bart” Roberts and Capt. John Phillips, who at one point sailed with Roberts, and those of Capt. George Lowther and Capt. Ned Low, who at one time sailed with Lowther. (Wikipedia gives the text of all four, plus that of Capt. John Gow, which I’ve excluded because it’s not clear whether his crew ever actually sailed under them.) Their many commonalities reflect not just a common pirate culture, but a recognition of the need for certain rules on any pirate ship.
The highest priority in the pirate articles was the equality of the crew members. Every code stated that crew members equally share in the plunder. Roberts’ code, the most elaborate, also called for equality in voting, provisioning, and joining boarding parties. The captain, quartermaster, and a few other officers got somewhat larger shares (typically two for the captain, though Capt. Phillips had to make do with only a share-and-a-half), but that’s about the only exception to equality on pirate ships. This put them in marked contrast to merchant vessels and navy ships, in which authority and pay were structured very hierarchically. It’s no wonder sailors sometimes chose to join a pirate vessel that attacked them. Pirate ships offered sailors more authority over their own lives, as well as a chance at more money, so long as you didn’t also mind the risk of being hanged.
Next in the articles came discipline. Pirates by their nature had to be ready and willing to engage in combat whenever they came upon a potential prize. Roberts and Phillips made this explicit in their codes: weapons were to be kept in a state of readiness at all times. Perhaps even more importantly, cowardice and desertion were forbidden according to all four of the codes. The most typical punishment for those crimes: death by being marooned.
Marooning was a simple and devilish punishment. The idea was to strand the offending pirate on a small island that lacked food, shelter, or fresh water. Preferably the island should be far away from the shipping lanes, such that the chance of rescue was unlikely. The marooned sailor was sometimes given a bottle of water or rum. But he was always given a pistol, and enough powder and shot to blow his own brains out. So the marooned sailor had two choices: die quickly from a bullet to the head, or die slowly from starvation and dehydration while hoping that maybe a ship might come by and rescue him.
Most marooned pirates probably died. Without witnesses, their ultimate fate was lost to history. But some survived. Captain Edward England was marooned by his crew over a dispute on the treatment of captives, was left on the island of Mauritius in the Indian Ocean in 1720, along with three pirates who had taken his side in the dispute. They managed to escape to Madagascar.
Capt. Lowther, whose articles are among those we are examining, was marooned, so to speak, not as a punishment, but due to misadventure. He had taken his ship to a small island to be careened, that is, to be rolled on its side on a beach to scrape off marine growths and repair the hull. Unfortunately for Lowther, an armed merchant vessel spied the pirates and attacked them, damaging the ship and taking much of the crew prisoner. Caught on a small island with no hope of rescue, Lowther is said to have shot himself in the head.
But piracy wasn’t all hard rules and tragic endings. Three of the codes contained incentives for good performance at helping find loot, such as sighting a prize or being part of the boarding party. (And probably the fourth vessel offered the same rewards, but just didn’t put them in their code.) And should you be injured in combat, all four codes offered you compensation according to the severity of your injuries. Lose a leg? Three out of the four sets of articles would pay you 800 Spanish dollars; Ned Low’s crew cheaped out and would only pay you 600. However, if you ever felt a little envious of some legless crew member for getting cash up front, and tried to take treasure for yourself instead of turning it over to the common treasury, you were violating the equality of sharing, and that would get you marooned.
Piracy was a violent life, no doubt, and the captains and crews knew it. So they set rules to keep from destroying themselves. Quarreling on board was absolutely prohibited, and was punished at the crew’s discretion. Roberts’ code contains what was probably the “safety valve” for this rule: if you wanted to fight, you had to take it ashore.
More curious to the modern eye, but just as essential, was the rule common to all four codes against gaming on board. Why? Think about it. The premise of piracy is that all will share and share alike. But if gaming is allowed, some will leave the ship much the richer, while others will have little to show for their efforts. Gaming would breed dissention and internal conflicts among the crew. It would increase dissatisfaction among those that no longer were making a profit from the voyage. So it was bad for the unity of the crew, for the happiness of the crew, and for the success of the voyage. This rule was so old it can be traced back to buccaneers like Henry Morgan. For much the same reason, Roberts’ rules include one that the crew will not break up until everyone makes a fortune of £1000. With the threat of death by execution hanging over them, pirate ships needed committed crews.
Only Roberts’ and his one-time crew member Phillips’ rules say anything about keeping women off the ship, or prohibiting pirates from molesting “prudent” women. I suspect this is yet another attempt to maintain discipline and keep the crew from internal conflicts. It was unlikely that a pirate ship would encounter sufficient women at sea to keep their entire crew happy. Best that everyone go without until the next time the ship visits a port. Not all crews felt that way; Low’s gang-raped and tortured at least one woman. But then Low was a psychopath, and probably inspired his crew to such deeds.
No women, no gambling: life on a pirate ship could get pretty dull. What to do for a diversion? Why, music, of course. Pirates loved music. I doubt they were great fans of Johann Sebastian Bach; they probably liked country airs and other old traditional songs. So when they took prizes, if they found any musicians aboard, they often “forced” them to join the pirate crew. But the pirates were not without some humanity. Roberts’ code contains a provision that the musicians are guaranteed Sunday as a day of rest. But they couldn’t refuse to perform any other day!
And that’s symbolic of these pirate articles in general: a mix of concern for the free and equal members of the crew, combined with the need for iron discipline among a society of violent men. Because that’s what these pirates were: an egalitarian society of criminals.