- Published on
Marcus Aurelius Gives a Code Review: Stoic Philosophy for Developer Mental Health
- Authors

- Name
- Youngju Kim
- @fjvbn20031
- The Emperor's Private Journal
- What Stoicism Actually Is
- Epictetus and the Dichotomy of Control
- Memento Mori: Remember Death
- Amor Fati: Love of Fate
- Seneca and the Currency of Time
- The Three Stoic Disciplines
- Stoicism and Imposter Syndrome
- Practical Stoicism for Developers
- Closing: The Emperor's Last Word
- References
The Emperor's Private Journal
Somewhere around 170 CE, the most powerful man in the Western world was having a bad day.
Marcus Aurelius Antoninus — emperor of Rome, commander of 400,000 legionaries, administrator of the largest empire in history — was also dealing with plague, German invasions, financial crises, and political backstabbing. Not so different from a bad sprint, really.
Every night, he wrote in a private journal. In Greek, not Latin — Greek was the philosopher's language, the language of rigorous thought. He wrote it for no one but himself. The title: Τὰ εἰς ἑαυτόν — To Himself. What we call the Meditations.
The remarkable thing about reading the Meditations today is how immediately applicable it feels. Change a few nouns, and Marcus could be a senior engineer writing performance review season reflections.
"Confine yourself to the present." — Meditations VIII.7
If that's not a prompt for closing your Slack notifications and actually fixing the bug, I don't know what is.
What Stoicism Actually Is
Stoicism was founded in Athens around 300 BCE by Zeno of Citium, who taught in the Stoa Poikilē — the painted porch — giving the school its name. It spread to Rome and produced three towering figures: Marcus Aurelius (emperor), Seneca (statesman and playwright), and Epictetus (former slave).
The central claim of Stoicism is elegant and radical: External events do not disturb us. Our judgments about external events disturb us.
As Marcus puts it: "If you are distressed by anything external, the pain is not due to the thing itself, but to your estimate of it; and this you have the power to revoke at any moment." — Meditations VIII.47
This is not passivity. This is a precise claim about where the work of a good life actually happens: inside, not outside.
Epictetus and the Dichotomy of Control
The most practically useful concept in Stoicism belongs to Epictetus, the former slave. His Handbook (Enchiridion) opens with a distinction that, once you've seen it, you cannot unsee:
"Τῶν ὄντων τὰ μέν ἐστιν ἐφ' ἡμῖν, τὰ δὲ οὐκ ἐφ' ἡμῖν." (Of existing things, some are in our power and some are not in our power.) — Epictetus, Enchiridion 1.1
In our power: our judgments, impulses, desires, aversions — our inner mental activity. Not in our power: our bodies, reputations, property, other people's actions.
Applied to developer life:
| In My Control | Not in My Control |
|---|---|
| The quality of my code | Whether my PR gets merged |
| How I respond to a review | The reviewer's tone |
| Monitoring after deployment | Third-party API failures |
| My own learning rate | Team's technology decisions |
| Recognizing my burnout | Company headcount decisions |
The Stoic prescription: invest your energy in the left column. Accept, without distress, whatever happens in the right column. This doesn't mean not caring — it means not allowing outcomes you can't control to determine your inner state.
Memento Mori: Remember Death
The most counterintuitive Stoic practice:
Memento mori — remember that you will die.
In modern ears this sounds morbid. To the Stoics it was liberating. When you hold your own death in view, the code review that seemed devastating this morning suddenly shrinks to its actual size. The promotion you didn't get, the architectural argument you lost, the product that got cancelled — these things are real, but they are not the scale of a human life.
Marcus uses a sharp variant of this practice he calls the view from above: imagine observing your situation from the perspective of the cosmos, or of history. Alexander the Great and his enemies now share the same dust. All the Roman emperors Marcus knew of were gone. He would be gone too.
"Alexander the Great and his mule driver both died and the same thing happened to both." — Meditations VI.24
This is not nihilism. Marcus cared intensely about ruling well. But the cosmic perspective kept the small things from becoming large things. He ran an empire; we run microservices. Neither of us should let a bad code review ruin a week.
Amor Fati: Love of Fate
Friedrich Nietzsche coined the phrase amor fati — love of fate — but the Stoic roots run deep. Marcus expresses it as:
"The impediment to action advances action. What stands in the way becomes the way." — Meditations V.20
This is perhaps the most useful single sentence in Stoic philosophy for software engineers.
The production incident you're dealing with is not an obstacle to doing good work. It is the work. The legacy codebase that seems like punishment is the actual problem your team was hired to solve. The hostile stakeholder who keeps changing requirements is the real-world complexity that separates software engineering from puzzle-solving.
Amor fati doesn't mean pretending bad things are actually good. It means developing the orientation where you meet obstacles as the substance of a meaningful professional life, rather than interruptions to it.
Summum bonum — the highest good — in Stoic philosophy is not money, fame, or career success. It is virtue (ἀρετή, arete): the exercise of reason and ethics in every circumstance, regardless of outcome.
Seneca and the Currency of Time
Of all the Stoics, Seneca is the most urgently readable. He wrote letters to a friend named Lucilius that read like the emails a very wise colleague sends at the end of a long day:
"Dum differtur vita transcurrit." (While we delay, life passes.)
And more directly:
"Ita fac, mi Lucili: vindica te tibi." (Do this, my Lucilius: reclaim yourself for yourself.)
Seneca believed that most people spend their lives in a peculiar poverty: they have money, health, and opportunity, but they give their time — their actual lives — to others without a second thought. They're too busy for what matters.
For developers in the attention economy, this lands hard. How many hours last week did you spend in meetings that could have been documents? How many evenings did you spend anxiously refreshing Slack? How much of your attention — the substance of your life — went to the urgent rather than the important?
"Nusquam est qui ubique est." — Seneca, Letters 2.2 (He who is everywhere is nowhere.)
Slack notifications, email, JIRA, GitHub, Confluence, Pagerduty. The engineer who is everywhere is nowhere. Seneca would have had thoughts about this.
The Three Stoic Disciplines
Marcus Aurelius organized his practice around three disciplines, articulated clearly by the later philosopher Epictetus (Robertson, 2019):
Discipline of Assent (Judgment)
Don't react automatically to events. Pause between stimulus and response. When a code review comment lands with "this is completely wrong," the Stoic move is not immediate defense or shame. It is: Is this factually accurate? Is this about my code or about me? What is actually being said here?
The Stoics called the automatic emotional reaction a passion (πάθος, pathos) and distinguished it from a rational emotion (εὐπάθεια, eupatheia). You can feel frustrated; frustration is information. But the frustration shouldn't drive the response.
Discipline of Action (Impulse)
Act for the common good, but hold the outcomes loosely. In Stoic terms: have preferred indifferents (προηγμένα ἀδιάφορα). You should try to write excellent code — that's a reasonable preference. But the specific outcome (merge approval, praise, promotion) is not within your control and should not be the source of your self-worth.
Practically: write the best PR you can, respond thoughtfully to all feedback, and then detach from the result. The quality of your effort is yours. The decision belongs to the team.
Discipline of Desire (Wanting and Avoiding)
Desire only what you can control. Fear losing only what you can control. Since reputation, job security, and career advancement are all, ultimately, not fully in your power — the Stoic does not build her identity on them.
This sounds ascetic. It isn't. Marcus owned great wealth, wielded enormous power, and cared about results. But he held these loosely enough that losing them didn't make him someone else.
Stoicism and Imposter Syndrome
The Meditations reveal something startling: Marcus Aurelius, emperor of Rome, had imposter syndrome.
He worried constantly about whether he was living up to his philosophy. He berated himself for laziness, for spending too long in bed, for not being as good a person as his Stoic heroes. The most powerful man in the Western world doubted himself in almost exactly the ways junior engineers do.
His response is instructive. He didn't try to eliminate the self-doubt — he redirected his attention. Instead of asking am I good enough? (unanswerable, dependent on external validation), he asked am I doing my best work right now, with the tools I have? (answerable, within his control).
"You have power over your mind, not outside events. Realize this, and you will find strength." — Meditations
Imposter syndrome is, in Stoic terms, a confusion about which column you're in. You feel inadequate because you're measuring yourself against an external standard (other people's perception of you) rather than an internal one (are you improving, are you honest, are you trying). The Stoic move is to return to what you can actually control.
Practical Stoicism for Developers
Morning Premeditation (premeditatio malorum) Five minutes before starting work: what difficulties might I encounter today? A contentious PR review? A confusing requirement? A production alert? Visualize handling each with equanimity. This is not pessimism — it's inoculation.
Evening Review (Seneca's practice) Three questions at day's end:
- What bad habit did I struggle against today?
- What virtue did I practice?
- In what way did I improve?
The Dichotomy Check When stressed: is this in my control, or not? If not, what is the part of this situation that is in my control? Redirect energy there.
The View from Above When a conflict feels all-consuming: what would this look like in a year? In ten years? To a thoughtful observer on the other side of the planet? Scale restores proportion.
Closing: The Emperor's Last Word
Marcus Aurelius died in 180 CE, campaigning on the Danube frontier. He never published the Meditations. It was never meant for us. It was a private training regimen — a man who happened to be running the world, reminding himself daily of principles he kept forgetting under pressure.
"The first rule is to keep an untroubled spirit. The second is to look things in the face and know them for what they are." — Meditations VIII.7
An untroubled spirit, not because nothing is hard, but because you've located your self-worth somewhere that bad code reviews cannot reach. Looking things in the face, not pretending problems don't exist, but not catastrophizing them either.
The production server will go down. The PR will get rejected. The roadmap will change. The code you were proudest of will be deleted.
And you, like Marcus on the Danube, will write your reflections, return to the work, and choose — one more time — to be someone who meets difficulty with equanimity.
That's the emperor's code review. And it approves your PR.
References
- Aurelius, M. (c. 170-180 CE). Meditations (Τὰ εἰς ἑαυτόν). Gregory Hays trans. (2002). Modern Library.
- Epictetus (c. 108 CE). Enchiridion. Nick White trans. (1983). Hackett Publishing.
- Seneca, L.A. (c. 65 CE). Letters from a Stoic. Robin Campbell trans. (1969). Penguin.
- Robertson, D. (2019). How to Think Like a Roman Emperor. St. Martin's Press.
- Holiday, R. (2014). The Obstacle Is the Way. Portfolio/Penguin.
- Irvine, W.B. (2008). A Guide to the Good Life: The Ancient Art of Stoic Joy. Oxford University Press.