If a professional programmer ever tells me that he/she has never been frustrated by programming, I won’t believe him/her. There are so many ways of getting blocked when programming. So many ways your code can fail to achieve what it’s supposed to achieve. Frustration is at the core of the job of software engineering. How should you deal with it?

Live with It

Frustration is totally normal. You have to accept it. Easier written than done, right?

Try to remember first that you’re doing things that not everyone is capable of. You might not manage to deal with the problem at hand right now, but it’s ok; you can fail. Don’t necessarily see failure as a bad thing. It’s just an opportunity to do better next time.

Second, you can view frustration as a sign that you’re getting outside of your comfort zone. If you want to learn stuff, you’ll encounter problems and most probably get stuck at some point. But you’ll get over it in the end. It will make you stronger and wiser.

The process of learning things takes time. Moreover, programmers should never stop learning, so don’t burn yourself out trying to assimilate everything in one shot just to be finished with it.

Finally, frustration just doesn’t help. At all. On the contrary, it prevents you from correctly organizing your ideas and thinking clearly. The same happens in gaming, for example. The more you lose and you don’t accept it, the more annoyed you get, the less lucid you will be to win the next game. The moment you realize that frustration can only reduce your proficiency to solve a problem, you’ll have done half the job of dealing with it.

Be Patient

The most classic advice for dealing with frustration is to do something else. It doesn’t mean you’re avoiding the problem. You’ll have to come back to it eventually. The goal is to give it a break. Focus on something else while you mull it over in the back of your mind.

Thinking for hours about a problem tires your mind. You need time to make sense of the information and process it. Forcing your mind to continue to work — out of desperation or pride — will just have the effect of weakening it even more. You have to think of your brain as a muscle and let it rest.

Getting frustrated? Not a bit.

So take a break. Go pour yourself a cup of coffee. Think about something else. You could also relieve your mind by tackling another simpler problem that you know how to solve. The benefit would be that you will feel reinvigorated for managing to keep things moving forward.

Sometimes looking at a problem with fresh eyes will make it much clearer. It is amazing to see how our mind is capable of rearranging information unconsciously. One would curse oneself for not finding the solution before. This shows even more how inefficient it is to persist in solving a problem on which you block.

Another typical advice is to take a pen and paper, and start writing down what you have to do. Break down the problem into more simple subproblems. Jumping directly to coding is a bad habit. You have to make sure you fully understand the problem and build the plan of your approach to tackle it before heading to code. You could also write some pseudocode if it helps.

You’re Not Alone

First, there are most likely a lot of programmers who have already encountered the same issue. Use the internet. As a beginner, it takes time to find the proper solution. After some practice, though, you become effective at finding help on Google. However, it’s important to try not to blindly copy snippets of code from Github.

Frustration while programming? Never.

Related xkcd: Wisdom of the Ancients (979)

Stuck on an apparently simple problem? Swallow your pride and ask a colleague! Try to explain to him/her what you’re trying to do. More often than not, you’ll actually resolve the issue by yourself. It’s highly probable, too, that something which seems obvious to you won’t be to him/her. The following discussions could lead you to the solution. As Bob Martin wrote in “The Clean Coder: A Code of Conduct for Professional Programmers”:

“Programming is so hard, in fact, that it is beyond the capability of one person to do it well. No matter how skilled you are, you will certainly benefit from another programmer’s thoughts and ideas.”

We all have been there once, especially when beginning to learn. At first, programming seemed overwhelming. It was quite easy to lose motivation. As I shared in the Secrets to Staying Motivated as a Software Developer, you are not alone! We all know how much programming can be frustrating sometimes.

Most programmers are willing to help each other. I think that the perfect place for that is the /r/learnprogramming subreddit. Below is an example of the reaction from someone who felt frustrated to learn Ruby, after he received a lot of positive feedback on his thread:

“Holy shit you guys are extremely patient and helpful (a redditor is actually helping me go through a problem as I write this). […] this thread only encourages me to keep pursuing this path and plow through this obstacle”

Step Back

You’ll often be confronted by problems with code, but also by situations directly involving people. In this case, too, there are many ways to get frustrated with your colleagues’ behavior. Maybe it does not seem logical to you. Or you disagree. Or it doesn’t make sense. In any case, you have to get over it, because you can’t let frustration have a negative effect on your work.

If you get frustrated with some people at work, try to take a step back and analyze the situation objectively. Are there some pieces of information you’re not aware of? These could explain the reaction of your colleagues. Challenging yourself can also be beneficial: am I actually wrong? Is my solution the best? People make mistakes, including you.

Then, it’s a matter of communication, and developers are not the best at it. Among the tips to improve your communication skills as a software developer that I shared some weeks ago, I think that some could help you deal with your frustration. Try to put yourself in your colleagues’ shoes, they might have a reason to react like they do. And then, you should try to talk to them and defuse whatever bad feeling is building between you.

Dealing with frustration is hard, since it puts you in a poor state of mind to get any quality work done. The best advice for you could be to avoid reaching the point where frustration affects your ability to think clearly. Don’t let it take over. As soon as you feel frustration growing in you, take action on it! Take a break, bounce ideas off of others, or work on another problem instead for a while.  Then, come back to that frustrating problem with a fresh outlook, and you’ll be ready to deal with it in a more positive state of mind.