You ever try to implement something simple but for some strange reason it doesn't work. So you try a possible solution but then something else doesn't work. You keep trying different workarounds but every time something different isn't working. Every time you get one step closer you also get one (or more) step farther from solving this problem and its now been 3 hours when this should have taken you 10 minutes. And it still isn't solved.There is no one in your company who can help, and you are about to put your fist through your screen.At this point you are so frustrated you can no longer think about the problem clearly. What should you do at this point? Or what can you do to avoid reaching this point? 
Dealing with frustration when things don't work
productivity;problem solving
Although this is a real problem, it isn't specific to programming. However, it is IMHO so important that it deserves a place on this forum.My suggestions: have a break. Go for a walk, meditate, sleep, do physical activity* - do something completely different to allow your brain to relax and get out of the mental rut, while letting your subconscious work on the problem in peace. Usually it delivers results surprisingly fast - it just needs to let you know about it. But while your conscious mind is desperately repeating the same cycles of thoughts over and over again, it won't be able to listen to anything else.what can you do to avoid reaching this point?Relaxation and mindfulness techniques are a key to get over the stress reactions and allow your mind to focus clearly. And practicing these really pays off. When someone is experienced in these, (s)he can already notice the stress level rising before the frustration could take over. Then one can interrupt the cycle of thoughts e.g. by taking a few deep breaths, or doing a couple of minutes relaxation practice. This may be all what is needed at that point.* kiss your partner, caress your pet - suggestions from my wife :-)