What Developers Can Learn from the Odyssey

In Developers Should Read the Classics Too I started with Homer and then never came back to him. Six Classics You Can Finish in a Weekend left him out because the Odyssey is not a weekend book. It has twenty-four books and about twelve thousand lines. Like every Greek kid I first met it at school and I understood very little of it then. When I read it again as an adult I saw a book about a man who is trying to finish one project, getting home and the project keeps slipping. Ten years of war and then ten years of travel. The hero is not the strongest man in the story. The first line calls him polytropos, a man of many turns and that is as good a description of a good debugger as I know. For each episode I give the book number so that you can read the original. Most of them are a few pages long.

Zeus on blame (Book 1) Link to heading

The first speech in the Odyssey, before Odysseus even appears, is a complaint by Zeus. Mortals blame the gods for their troubles, he says, but they bring most of them on themselves, through their own recklessness, beyond what fate gives them. Homer put this on the first page on purpose. I have blamed the hardware, the network, the previous developer, the framework and the customer. Most of my outages were mine.

Mentor (Books 1 to 4) Link to heading

Telemachus is twenty and he has spent his life watching a crowd of suitors eat his father’s estate. Athena comes to him in the form of Mentor, an old friend of Odysseus and tells him to stop sitting around, call an assembly and sail to Pylos and Sparta to ask Nestor and Menelaus for news of his father. This is where our word mentor comes from. Notice what the mentor does. He does not fix anything and he does not tell the young man the answer. He tells him to go and ask the people who know and he goes with him on the first trip. Telemachus comes back a different person. The best thing I ever did for junior developers was to send them to the right person instead of answering myself.

Calypso’s island (Book 5) Link to heading

Odysseus has spent seven years on an island with a goddess who offers him immortality and every morning he sits on the shore and cries looking at the sea. When Hermes brings the order to let him go, Calypso asks whether his wife is more beautiful than her. He answers that she is not and that he still wants to go home. Then he builds the raft himself. Homer spends a page on it, with the twenty trees, the axe, the adze, the joints and the deck, like a craftsman describing a job. Some jobs pay well, are comfortable and are not where you want to be. Seven years is about how long it takes to notice. And when you leave, you build the raft yourself.

Nobody (Book 9) Link to heading

The Cyclops Polyphemus eats his men two at a time. Odysseus gets him drunk, tells him that his name is Nobody and blinds him with a burning stake. The other Cyclopes come to ask who is hurting him and he shouts “Nobody is killing me”, so they leave. The trick works and the men escape under the sheep. Then, with the ship safely away, Odysseus cannot help himself. He shouts his real name across the water, so that Polyphemus will know who blinded him. Polyphemus prays to his father Poseidon and that curse is the reason the trip takes ten years and he arrives home alone. The work was done. The mistake was the victory lap. I have seen the clever fix followed by the boastful message in the wrong channel, read by the wrong person. Ship it and keep quiet.

The bag of winds (Book 10) Link to heading

Aeolus, the keeper of the winds, gives Odysseus a leather bag with all the bad winds tied inside it and sends a west wind to carry the ship home. For nine days Odysseus steers without sleeping. They come so close to Ithaca that they can see people lighting fires on the shore. Then he falls asleep. The crew, who were never told what was in the bag, decide that it must be gold and silver that he is hiding from them and they open it. The storm blows them all the way back and Aeolus refuses to help a second time. There are two lessons here. The crew touched what they did not understand because nobody explained it to them and the bag had no label. And the only person who knew did not write it down before he fell asleep. The engineer who keeps the whole system in his head is the bag of winds.

Circe (Book 10) Link to heading

Circe turns the crew into pigs. Hermes gives Odysseus a herb that protects him, he forces her to turn the men back and then they stay on her island for a whole year, eating and drinking. In the end the crew comes to him and says, more or less, “Man, it is time to remember your home.” He had forgotten. After a hard problem comes a comfortable period and it is easy to forget what the project was about. It helps to have people who are allowed to tell you.

The Sirens (Book 12) Link to heading

Odysseus wants to hear the song that nobody survives. So he plugs the ears of the crew with wax, has them tie him to the mast and gives an order before they come near the Sirens. If I beg you to untie me, tie me tighter. He begs and they tighten the ropes. This is the oldest description I know of a rule that you make while you are calm, for a moment when you will not be. Branch protection, no deployments on Friday, the test suite that must pass before a merge, the production password that you do not know. The point of these rules is that the future you cannot undo them. Philosophers call it a Ulysses contract.

Scylla and Charybdis (Book 12) Link to heading

Circe explains the strait. On one side is Scylla, with six heads and she will take six men for certain. On the other side is Charybdis, a whirlpool that swallows the whole ship three times a day. Her advice is to go past Scylla fast and lose the six. He does and he hears them calling his name as she lifts them up. There was no option where nobody died. Most real engineering decisions look like this. Every option has a cost and the job is to pick the known, bounded loss over the bet that can take everything. A slow, boring and certain cost beats a gamble with the whole ship.

The cattle of the Sun (Book 12) Link to heading

Odysseus was warned twice, by Tiresias and by Circe, not to touch the cattle of the Sun. The crew lands on the island anyway, the winds keep them there for a month and the food runs out. Odysseus goes inland to pray and falls asleep, again. Eurylochus tells the men that it is better to die at sea than to starve and that they can build the god a temple when they get home. They eat. Zeus destroys the ship and everybody drowns except Odysseus. The rule was easy to keep while they were full. A rule that only holds when nobody is hungry is not a rule. Every “temporary” exception made under deadline pressure sounds like Eurylochus. We will add the tests later. We will rotate the key after the launch.

Telling the story (Books 9 to 12) Link to heading

The famous adventures are not told by Homer. Odysseus tells them himself, after dinner, at the court of the Phaeacians, as a shipwrecked guest who has lost everything. He tells all of it in his own words, including his own mistakes, the shout at the Cyclops and the sleep within sight of Ithaca. He does not say that the gods did it. He says what he did. It is the best post-mortem I know and only after the telling do the Phaeacians take him home.

The swineherd first (Books 13 to 16) Link to heading

When he finally lands on Ithaca after twenty years, he does not go to the palace. Athena disguises him as an old beggar and he goes to Eumaeus, the swineherd, at the edge of the estate, where he spends days listening. He learns who is loyal, how many suitors there are and what the servants think. Then Telemachus returns and the two of them make a plan. Only then does he enter the palace. Nehemiah inspected the wall at night before he told anyone his plan and Odysseus does the same. Before you fix the system you inherited, go to the swineherd. Talk to the people at the edges; these are the people that know. Read the code as a beggar before you walk in as the king.

Argos (Book 17) Link to heading

His old dog, which he trained as a puppy before he left for Troy, lies on a heap of dung, full of ticks, neglected by everybody. The dog recognises his master after twenty years, moves his ears and his tail and dies. Nobody else has recognised Odysseus yet. Argos is every old script and old service that still does its job while nobody looks after it. Go and look at it before it dies.

The bow (Book 21) Link to heading

Penelope sets a contest. Whoever can string the great bow of Odysseus and shoot an arrow through twelve axe heads will have her. The suitors warm the bow and grease it and still cannot bend it. The beggar asks to try and he strings it without effort, the way a musician strings a lyre and the string sings like a swallow. Then he shoots through the twelve axes. It was his own tool and he had used it for years. The suitors had the best technique for bending a bow and had never held this one. David refused Saul’s armour for the same reason. Nothing can replace years of using your own tools.

The bed (Book 23) Link to heading

The suitors are dead and Penelope still does not believe that it is him, so she tests him. She tells the nurse to move the bed out of the bedroom for the stranger. Odysseus loses his temper. Who moved my bed? He built it himself around a living olive tree, the tree is one of the bedposts and it cannot be moved. Only the two of them know this and that is how she knows. I think of this scene every time I find a strange constraint in a system and nobody can explain it. Somebody built it around a tree. Before you move it, find out whether the tree is still there. And if you are the builder, write down where the tree is.

I left out a lot. There is nothing here about Nausicaa, the visit to the dead or the loom of Penelope. I only wanted to show that the oldest book we have about finishing something is still useful to people who finish things for a living.