How to Deal with Anger as a Programmer

Anger. We all have faced it before. It is never a good feeling; nevertheless, it happens. Rather than letting anger control us, we must find a way to get control of it so we can move on with our lives and the code that we write.

Look, you may want to stick to programming, but in reality, the soft skills needed to overcome the problems we face every single day are 100 times more important than programming skills.

You can teach anyone to be a programmer, but finding a programmer who can control their emotions and overcome problems in their life is difficult. Anger is not a problem that all programmers face, but if you have to, then letting anger get the best of you can seriously dampen your career success.

My goal for this post is for you to feel like you have a grasp on how anger affects you and how you can control it.

As an example, let’s take a look at the story of Charles. He is a junior Python engineer at a big well-known  data company. He graduated from the University of Chicago about a year ago with a bachelor’s degree in computer science and a 4.0, and he wants to be the best Python engineer in the New York City area.

Only one problem: He sometimes gets too angry to focus on his work, specifically the difficulties of programming. When he runs into bugs in his Python library, he ends up screaming at his desk out of anger. One of his co-workers, Emily, notices this problem and mentions it to him. Charles had never even thought about his anger as a problem nor realized how it affected his work and co-workers. So he goes on a journey to understand anger and how to overcome it.

Why Anger Is Bad for a Programmer

As Charles begins his research, he sees a few things that make him realize how serious his anger is.

First are the health problems. He never noticed this because he never paid attention to it, but anger has terrible effects on his stress levels. It is an emotion that triggers the fight-or-flight response in the body that causes cortisol levels to rise.

That comes along with a ton of negative health consequences like higher blood pressure, increased chances of a heart attack, increased anxiety and depression, and much more. Looking at this, he says: “I definitely do NOT want any of these.”

But health problems are not the only effects of anger, which Charles realizes as he continues to do more and more research.

Anger affects his mental state. As one thing triggers him to be angry, he is more likely to be angry at a smaller thing right after. This will then also feed into his anger problem!

He realizes that when he is angry, he can only focus on what made him angry and the feeling of anger itself. So every second he spends being angry at a bug in his code that “should have worked” (I know we have all been there), causes him to not be able to focus on his goal of actually getting rid of the bug. Anger detracts from his life but what about the life of his co-workers, family, and friends?

Charles had no idea that his anger was starting to affect his co-workers until Emily approached him about it. She told him that his behavior was even causing his manager to rethink renewing his contract. Charles was taking his anger at a bug out on co-workers, blaming them for the changes they made in their code that caused his bug. It was ruining the morale of the team.

When Charles goes home, he complains and vents about the problem to his wife and kids, spreading the negative energy and anger to his home. This is putting a strain on his relationship with his wife and kids. Then, when he plays Fortnite with his friends, all he does is talk about the anger he feels because of his bug. His friends really do not like it when he gets angry, especially when it’s about work topics.

Programmers can do this from time to time: blame their mistakes on others and spread their frustration. In order to be a better programmer, remove this negative habit from your character.

How to Get Rid of It

Charles realizes he has a large problem on his plate and is determined to beat his anger issues and become a better programmer and person.

The first thing Charles needs to do is change his state of mind. The mind can generally be only positive or negative at one time. It can feel only one emotion at a time. Theoretically, if he is angry right now, he cannot be happy and angry at the same time.

There are a few things that can change his mental state. First he can try relaxing by meditating or getting a massage. These things can take him from a negative and angry state to a relaxed, more positive one. Another method is watching his favorite YouTubers. Their funny clips can make him go from angry to laughing in a few minutes.

Those might not be things that can be easily done while at work, so I have something more basic for you to do at your desk. Just take a few deep breaths. Breathing like that for a little while is a great way to relax and put anger aside.

Now that he is in a more positive and relaxed state, Charles can look at the problem and accept it for what it is. It’s a bug. He has solved hundreds of bugs in the past. Why is he letting this one get the best of him?

So he chooses to accept the problem. Realizing that it’s fact. It happened. All he has to do now is find a way to fix it.

Now, he revisits that bug he found earlier in the morning, the bug that triggered his anger. It happened on line 134 in main.py. He looks at the stack trace and realizes it’s coming from a function he wrote a year ago. He did not handle the edge case that was causing the bug.

He adds a simple if-else statement and fixes the bug. He then commits and pushes his changes, and leaves work happy, for once!

Never Be Angry Again!

Charles was able to come to his senses on his own and put his anger to the side. He changed his mental state from negative to positive. Then he learned to accept the problem as it was. Lastly, he looked at it logically, now that he was calm, and accepted it. This allowed him to come up with a solution! The fix only took a few minutes, but he could have wasted tons of time being angry.

That’s the thing with emotions and internal struggles: You can overcome them. There is always something under your control that you can do to help solve the problem. That is why I wrote a book on this topic.

Look at all the benefits Charles got from changing his habit of being angry. He now is a more productive programmer who squashes bugs at lightning speed instead of venting about them. His co-workers all like him much more because he is no longer blaming them for his mistakes. His wife and kids are closer to him because he is not angry at them all the time.

What are you waiting for?