How to Beat Coding Frustration with Self-Compassion

April Wensel
9 min readSep 21, 2016


Read the latest version of this post:

Coding can be stressful. It doesn’t matter if you’re just starting out or you’ve been doing it for 30 years—you are going to experience difficult moments. You may become frustrated when stuck troubleshooting a bug, irritated by a disagreement with a coworker, or stressed out about a deadline.

Self-compassion is an effective tool for managing your negative emotions so that you can continue to make progress toward your goals. As I’ve written previously, it also helps prevent burnout. Most importantly, “Self-compassion is essential to unlocking our ability to cultivate compassion for others.” To use a tired but apt reference, it is like the airplane safety instructions that advise you to secure your own mask before helping others.

“Self-compassion is essential to unlocking our ability to cultivate compassion for others.”

In this article, you’ll find specific strategies for practicing self-compassion while dealing with any of the many coding-related frustrations you may encounter. Self-compassion doesn’t solve your coding problems, but it puts you in a healthier mindset to find solutions.

What is Self-Compassion?

Kristin Neff, a leading researcher in self-compassion, defines the concept in the following way:

Self-compassion entails being warm and understanding toward ourselves when we suffer, fail, or feel inadequate, rather than ignoring our pain or flagellating ourselves with self-criticism.

To be self-compassionate means that in difficult moments, you treat yourself just as you would treat your best friend — with kindness, patience, and understanding.

Our natural response to our own mistakes and shortcomings is likely not anything resembling self-compassion. We call ourselves names — “I’m such an idiot! How could I forget to run the database migration?” We doubt our abilities — “I can’t believe I haven’t figured out this bug—I don’t even belong here.”

These negative thoughts exacerbate an already stressful situation and block you from seeing solutions to your problems.

Negative thoughts exacerbate an already stressful situation and block you from seeing solutions to your problems.

Self-compassion, on the other hand, steps in to give you a moment’s respite from your stressful or uncomfortable feelings and allows you to plan a path forward. Olivia Fox-Cabane, who encourages using self-compassion as a tool in building charisma, summarizes the benefits in The Charisma Myth:

Self-compassion delivers an impressive array of benefits: decreased anxiety, depression, and self-criticism; improved relationships and greater feelings of social connectedness and satisfaction with life; increased ability to handle negative events; and even improved immune system functioning.

As Elisha Goldstein summarizes in Uncovering Happiness, “[S]elf-compassion allows us to activate the brain’s self-soothing system.”

Sounds great, right? How do you it?

Here are some steps you can implement immediately whether you’re stuck on a bug, nervous about meeting a deadline, or facing some other seemingly insurmountable challenge.

Attention: Doubting Thomases and Thelmas

It’s totally acceptable if you’re thinking, “I don’t have time for this self-help B.S. — I just need to figure out this bug!” That was my initial response to any suggestions of self-compassion. The research behind it was compelling enough to make me try it, though, and once I did, I found that it worked. Self-compassion helps by getting you in a more relaxed and focused mindset, which will help you solve that coding problem or navigate that difficult interpersonal interaction. Don’t believe me? It’s a low-cost technique to implement, so why not keep an open mind and give it a try?

1. Acknowledge and accept how you’re feeling

Whether you’re feeling sadness, anger, anxiety, or any other emotion, pause for a moment, interrupt your negative thoughts long enough to describe exactly how you’re feeling.

For example, “I’m disappointed that I haven’t figured this problem out, and I’m scared that asking for help will make people think that I’m not intelligent enough for this job.”

It’s especially helpful if you take the time to write down your feelings. but even just pausing for a moment, taking a breath and mentally assessing your emotional state can be helpful.

Acknowledging how you’re feeling can help defuse negative emotions. You’re no longer feeling some unidentified mass of darkness, but rather, specific emotions. You may not always know the reasons for the emotions. “I’m angry!” might be the best introspection you can do in the moment, but even making that simple observation is better than trying to deny or suppress your emotions, which will only cause them to fester.

If you’re too embarrassed to think about your feelings, consider this assertion from Ryan Holiday in The Obstacle is the Way:

“Real strength lies in the…domestication of one’s emotions, not in pretending they don’t exist.”

Being mindful of our emotions takes some of their power away. By labeling our emotions, we assert that we are distinct from them. We don’t have to see our emotions as permanent fixtures in our lives, but rather just temporary conditions we’re experiencing. Mindfulness gives us this separation. As Karen Armstrong puts it in Twelve Steps to a Compassionate Life,

The purpose of mindfulness…is to help us detach ourselves from the ego by observing the way our minds work.

Once we’ve observed the way our minds are working, it will be easier to identify what we might want to change in order to feel better.

2. Speak kindly to yourself

When we me make mistakes, our overwhelming instinct is to punish ourselves. “I pushed that bug to production, and I should feel bad about it.” Maria Popova refers to this as “an epidemic of self-criticism” in our culture.

It seems to be especially prevalent among software engineers. Could this harsh self-criticism perhaps stem from the persistent need to prove your “ninja” or “rockstar” status? Are “rockstars” allowed to make mistakes?

Could this harsh self-criticism perhaps stem from the persistent need to prove your “ninja” or “rockstar” status?

Consider what goes through coders’ minds on an daily basis:

Of course, some of those tweets are likely meant in jest, and there is something to be said for self-deprecating humor, but burnout, anxiety, and depression are real problems facing our industry, and negative self-talk contributes to these problems.

Burnout, anxiety, and depression are real problems facing our industry, and negative self-talk contributes to these problems.

Instead, we can try reshaping our thoughts to be more supportive. The self-compassionate alternative to “I’m an idiot” could be something like, “I’m solving a difficult problem. It’s only natural that I will experience some challenges in trying to solve it. Let me try to look at the problem a different way. If I can’t figure it out in a couple hours, I’ll ask someone for help.”

If you think it will be difficult to take the time to reshape your thoughts in this way, you may be right! However, with practice, it becomes second nature.

One technique is to picture the person or animal you love most in the world and consider what you would say to that individual if he or she were facing a similar situation. Would you ever say to your friend, “This is an easy problem; if you can’t solve it, you’re just an idiot”? I would guess not. (If you would, stay tuned for future articles on showing compassion to others.) In a sense, self-compassion means being your own supportive, understanding friend.

Self-compassion means being your own supportive, understanding friend.

Another technique is to enumerate all the factors that have contributed to your current suffering. For example, when you made a mistake, were you hungry? Were you feeling tired because your child was up crying all night? Were you preoccupied because your best friend is in the hospital? The point is not to avoid taking responsibility for your actions or to place the blame on others, but rather to recognize that you’re going through something difficult, possibly on multiple levels. Olivia Fox-Cabane explains that there’s an important difference between self-pity and self-compassion:

“self-compassion is feeling that what happened to you is unfortunate, whereas self-pity is feeling that what happened to you is unfair.”

You’re a human being, and you’re constantly dealing with struggles — that’s life. Self-compassion helps you recognize and process those struggles in a healthier way.

You might think, “But I made the mistake! It was all my fault, and I deserve to feel this pain.” Kristin Neff addresses this point well in Self-Compassion:

“[I]f our pain is caused by a misstep we have made — this is precisely the time to give ourselves compassion. […] Compassion is not only relevant to those who are blameless victims, but also to those whose suffering stems from failures, personal weakness, or bad decisions.”

That means that even if you missed a deadline because you were procrastinating on Facebook all day, you still deserve compassion. If you fail a test because you went out drinking instead of studying, you still deserve compassion. Even if you missed an important meeting because you slept through your alarm after staying up all night to watch Game of Thrones, you still deserve compassion.

Does this mean you’re off the hook for all the failures you’ve ever had? Not exactly, what it means is that as a fallible human being (even if you’re a self-proclaimed ninja or rockstar), you’re worthy of compassion and kindness no matter what you’ve done.

You’re worthy of compassion and kindness no matter what you’ve done.

Some of the worst phrases you can say to yourself begin, “I should have…” or “I shouldn’t have…” I would suggest removing these phrases entirely from your self-talk. What’s in the past will stay there, and your “should” phrases will only make you feel bad about it.

You may protest, “But I want to get better!”

Great! That’s the right attitude. Self-compassion doesn’t preclude a growth mindset — in fact, they work better together. Recognize that you’ve experienced a failure and see what you can learn from it and how you can improve in the future. Instead of “I shouldn’t have written the code that way,” try, “The way I wrote that code didn’t work out very well. Next time, I’m going to try it this way instead.”

When you’re kind to yourself, you don’t have to worry about negative emotions blocking you from self-improvement. Instead, you can remain confident that you can get better and focus on how you’re going to do it.

3. Remind yourself that you are not alone

One of the most powerful ways to show self-compassion is to remind yourself that everyone suffers. Whatever you’re experiencing, you are not alone. Even if you’re physically alone or you’re feeling emotionally alone, you’re still part of the human community, and that’s full of other people who are suffering just like you.

You are not strange for feeling frustrated while setting up your development environment. Others have also experienced this pain. You are not strange for feeling sad that your first pull request received a lot more feedback than you were expecting. Others have also felt this way.

But what about the “ninjas” and “rockstars” we mentioned earlier? If you feel you fit into one of these categories (and since they’re essentially meaningless terms, anyone could argue for membership), you might feel a sense of superiority to the other developers who aren’t part of this elite group.

That may feel great for your ego, but it’s not always great for your emotional wellbeing. As Kristin Neff warns, “the climb toward superiority is also a descent into isolation.”

You can’t simultaneously think you’re better than everyone and find comfort in the fact that you’re just another human being who is prone to suffering. The choice is yours.

If you do consider yourself above others and consider failure to be acceptable for most people, but not for you, you’re holding yourself to an impossible standard. As Neff explains,

“Striving to achieve high standards for yourself can be a productive and healthy trait. But when your entire sense of self-worth is based on being productive and successful, when failure is simply not allowed, then the striving to achieve becomes tyrannical.”

Personally, I’d rather consider myself part of the global fallible human community. Yes, I have some skills that others may currently lack. And yes, I’ve had experiences that others may not have had. And yes, I’m committed to improving my abilities every day. None of these elements of my identity make me better than anyone else.

What unites us is our shared suffering. This is at the heart of a compassionate mindset. It’s not meant to be depressing; it’s just a fact of life. There will be painful moments and joyous moments. We each encounter a different subset of these experiences, but we do experience both types. Reminding yourself of this fact can be a comfort.


Hopefully these techniques help you approach coding frustrations and other problems without excessive stress or anxiety. While it may at first feel weird — even cheesy — to articulate your feelings or to speak kindly to yourself or to ponder our shared humanity, over time these practices will feel more natural. And the good news is, these techniques can start working even if you think they’re stupid.

The good news is, these techniques can start working even if you think they’re stupid.

You might also notice that as you begin to feel more at ease, you are also able to approach other people with much more understanding and kindness. This, of course, is the ultimate goal — kindness for all!

It all starts with you.

About the Author

April Wensel is the founder of Compassionate Coding, a conscious business on a mission to transform the tech industry by training technologists in emotional intelligence.



April Wensel

Speaker | Founder, Compassionate Coding |