Stoicism and Programming

· 1034 words · 5 minute read

As everything in life programming comes with ups and downs. There are days when work is flowing and there are other days you are barely able to write a single line of code. Writing code professionally is an endeavour where celebration and frustration are never far apart. How can you best deal with this? What techniques help to soften these up and downs? One thing that helps me is way older than programming itself: the ancient philosophy of stoicism. So what is Stoicism and why should developers care about it?

The basis of Stoicism 🔗

Stoicism is one of the oldest schools of philosophy, originally founded by Zeno in the ancient Athens in the third century BC. Today’s most famous (and preserved) Stoics are from the Roman period, the second wave of Stoicism, so to say. Mainly three authors comprise the modern philosophy of Stoicism: Seneca, Marcus Aurelius and Epictetus.

Their philosophy is very approachable and practical. They don’t care too much about the morality of good and evil or what’s the meaning of life. The Stoics try to live their life in the best way possible and find rules and guidelines to make the most out of your limited time on earth. Since these three Roman philosophers have such a practical approach their texts are still relevant today and even if nearly 2000 years have passed since being written down we can still learn a lot from them for our modern lives.

Let’s look at a few situations you will face in your professional life as a programmer and how you can apply Stoic lessons and guidelines to them.

Stoicism and programming 🔗

Always give your best 🔗

Your manager gave you a dull assignment to work on. This sucks, obviously we all want to work on shiny and exciting tasks. But that’s not how life works, sometimes you have to do unexciting but nevertheless important work. So how do you deal with this? Do you drag yourself to work everyday and try to find shortcuts to get this project over with already? No, you would still come to work everyday and put your best effort in to finish this task in the best way possible.

And that is exactly what a Stoic does. You can’t control what life puts in your way, but you can control how you deal with it.

Take criticism seriously, not personally 🔗

One of the tough parts of professional life is dealing with criticism. It can be a tough pill to swallow if your boss tells you that your performance over the last week was not up to your usual level. How do you deal with it?

As a Stoic you certainly evaluate if your boss has a valid point and if so you will try to understand what caused this and try to improve. But you won’t get upset. Why should you? If it’s a fair point you should work on yourself and try to get better. If it’s unfair criticism you’ll discard it and don’t let it bother you.

You can’t control other people’s opinions and thus you shouldn’t let them control you.

Don’t get (too) frustrated 🔗

Everybody knows these moments where things just don’t work and everything you do leads to a dead end. You are staring at your screen for hours but still the solution eludes you. All you want to do is take your laptop and throw it across the room. But this anger and frustration does not help you. You don’t come closer to a solution if you remain in this state. Isolate yourself from the situation, take a walk or make a coffee and take some deep breaths. You’ll see that this gives you a better - more balanced - perspective on the problem at hand.

Stoics focus on being moderate. Don’t dwell in frustration, these negative feelings get you nowhere. But on the other hand, don’t get too euphoric after a success either, because the next obstacle is right around the corner. That doesn’t mean that you are not allowed to feel frustrated or euphoric, it just means that you shouldn’t focus on these feelings too long and keep looking forward instead because life doesn’t stop.

Look at the big picture 🔗

Have you ever been upset because you had to write another unit test or because your colleague nitpicks on some minor detail of your pull request? It’s understandable in the moment because you finished the task with all the requirements but still you should do more.

But look at it the other way around: wouldn’t you be glad if you start working on a legacy codebase and all the developers working on it before you had been just as diligent? If you have a wonderful house but one room is messed up, sooner or later the whole house will start to look messy. The only way to prevent this is to keep all rooms clean and it’s the same with a codebase: keep all new code to high standards and clean up constantly.

The Stoics knew that a single action can’t make you a good person, but if you’re doing good over and over again, eventually you will become a better person. It’s not so much about you and the single task at hand, it’s about the whole project and all the developers who work or will work with this code you are about to commit.

Conclusion 🔗

Looking at these examples you see that Stoicism not only has lessons that apply to programming; rather it is advice that can help you in countless situations you will face. If you’re curious to dive deeper into the Stoic philosophy try any of these books from the “famous three”:

  • Letters from a Stoic by Seneca
  • Meditations by Marcus Aurelius
  • Discourses by Epictetus

Or if you would rather want to start with a more recent book that will introduce you to Stoicism go with Ryan Holiday’s The Obstacle Is The Way. Or read Ryan’s fantastic blog (and newsletter) Daily Stoic.

Do you consult the ancient Stoics for life and work advice, too? Or what is your approach to deal with the craziness of modern life? Let me know in the comments or write me on Twitter.