Coding problem :/

I get these strange anxiety attacks when i dont program for a while. Especially when i have something exiting or difficult to code next. I get palpatations and stuff too. When i watch a movie ill inadvertently get up and want to stop it halfway, just to sit down again and try to calm myself, over and over again… Smoking cigarettes makes it worse. Anyone else get this or have advice?

Is there a name for coding anxiety attacks?

Odd, maybe it's just old fashion anxiety? Especially if its something that's going to be difficult (e.g. you doubt yourself, dont feel motivated enough to get the job done, etc).



I sometimes get ansy myself (and sometimes procrastinate) for such situations, but other times when Im dying to get into code, but can't due to other real life concerns (like this past week :x relatives!) I get restless, because I know what I want to do but just can't!

I think its very similar in my case…

It might not be very effective in your situation (personally I'd get professional help) but generally in order to calm yourself you can do various breathing exercises. This probably will not help during such an attack but maybe you'll get them less frequently if you do those exercises. A good one I know goes like this:


  • Grab a laptop of something similar in size, weight and stiffness (books or whatever might be at your disposal).
  • Lay down on the floor, back down.
  • Bend your knees and put your feet flat on the floor. If this feels uncomfortable change your position a little until it feels fine. It's important to keep your back flat on the floor and your belly straight up.
  • Put your laptop or laptop substitute on your belly, with the centre of it's weight on your bellybutton.
  • When breathing in, try to do this in such a way to raise the laptop as high as possible.
  • when breathing out, try to breath out as far as you can without hurting yourself or otherwise overdoing it, everything should still feel comfortable.



    Instead of using the "laptop" you can also try to imagine the air you are breathing to come in from your heels. Usually the "laptop" works better though. It's sometimes easier if a wife/girlfriend or husband/boyfriend puts her/his hand on your bellybutton instead of using the laptop and tells you when to breathe in and when to breathe out in a calm, preferably low and relaxed, voice. If he or she is a source of stress or somewhat stressed him- or herself I'd go for the laptop however. You can use your own hand to check your breathing as well (preferably after you managed the laptop).



    You may also want to slowly lower your intake of caffeine, alcohol, sugar and sugar substitutes. Smoking doesn't help either (actually that may depend on what you are smoking, but let's not go there). Generally this means drinking nothing but water (and 1.5-2.5 liters of it a day while your at it).

    If you do change your diet however do it slowly, sudden changes are hard to keep up and can sometimes actually be dangerous (exception for water, which is fine).



    Oh and I'd still go see a doctor (I'm not one), even if they may tell you the exact same thing your health is not something to place bets on.



    Well I hope you can get rid of it! Good luck.

Great advice Huscar!



I'd also recommend that you make sure you're comfortable while you're coding…  Make sure your monitor is at eye-level and the keyboard is at a height so that your arms are positioned as close to 90 degrees as possible…  Another thing I've noticed in my own time but rarely (if ever see mentioned) is pushing the keyboard/mouse in on your desk.  Due to not having a lot of depth in my desk at home, my keyboard/mouse used to be right on the edge of the desk, just giving enough room to put my wrist, but no forearm support.



I mention all this because I've noticed that when I'm not in a comfortable position I get punchy and make a lot more mistakes.



Is the anxiety akin to "I can't wait to get back to coding" or "I'm really dreading the next time I need to do some work"?

Maybe it helps if you code longer periods at a time instead of in between other things you have to do. That way you can get a bit more "fed up" with coding and it may not annoy you as much.

Very good point, I'm thinking of pulling an 'all nighter' once a week to make things go smoother, that way I dont have to break apart large tasks but can do each task untill its done.

That's not what I meant. Disturbing your sleep/wake cicle and skipping periods of sleep is generally a bad idea in this sort of situations. Other than that I think it's a good idea.

What if I do the all night thing, but regularly like once a week?

lanmower said:

What if I do the all night thing, but regularly like once a week?


That's still not regularly in terms of the body.  I've read somewhere that when police officers need to change their sleep patterns to work nights as opposed to days (or vice-versa) that it takes them some time to get back into a normalized pattern...  just food for thought.

I have a strange body though, I can switch several times a week… I think its because of when I was a waiter. Maybe what I'm experiencing is my body telling me its over stressed.

Yes that may well be what's happening. Sleep is something very important, especially when dealing with issues that require creativity, like programming :wink: . If you're having trouble getting enough sleep try cutting back on the following: alcohol, caffeine (any other drug-like bustances for the matter), late evening movies, going out late etc. (your brain must not be stressed before going to bed). Also make sure you make your body tired enough by means of say, sports.

Just because your body seems to have gotten used to a messed up sleeping rhythm does not make it right. The sooner you fall a sleep before noon the better your body rests, there's papers on that.



On the topic of sleeping: I had some pretty severe sleeping issues for a while, and I've learned a few tricks that improves your chances of good sleep.


  • Never let a screen be the last thing you've seen right before going to bed - Read a book, do the dishes…, preferably anything unrelated to your work.


  • A lot of creatives keep a notebook within reach of their bed - I did this (and a lot of awesome ideas do in fact conjure at this time…), and it kept me awake for countless nights. This technique would probably not work similarly or at all for everyone, but what I do now is that I just make some mental notes of what I want to remember in the morning, sort of convincing myself that if I can't remember it it can't have been important, and I actually remember it first thing in the morning or as soon as I see some hints, e.g. an open webpage.


  • On that same note though, don't keep on working inside your head once you're in bed. Either write down or take mental note of the important thoughts, then drop it. My way of doing that is for instance if I've been pondering on a game design, I will just try imagine actually playing the game, or seeing people's reaction when playing it. That is if I can't possibly think of something entirely unrelated of course.
erlend_sh said:

On the topic of sleeping: I had some pretty severe sleeping issues for a while, and I've learned a few tricks that improves your chances of good sleep.

- Never let a screen be the last thing you've seen right before going to bed - Read a book, do the dishes.., preferably anything unrelated to your work.

Have you tried sex? I think this would work also very good. ;)
Yeahh ... I know... we are nerds, freaks and game developers, so this is no option. :D
JackNeil said:

Have you tried sex? I think this would work also very good. ;)
Yeahh ... I know... we are nerds, freaks and game developers, so this is no option. :D


:lol: well done.

i used to have a habit of tapping/drumming the walls with my fingernails.  Got my mind off whatever and i got to rock out pretty hard!
sbook said:

JackNeil said:

Have you tried sex? I think this would work also very good. ;)
Yeahh ... I know... we are nerds, freaks and game developers, so this is no option. :D


:lol: well done.

i used to have a habit of tapping/drumming the walls with my fingernails.  Got my mind off whatever and i got to rock out pretty hard!


I fail to see the connection between the quoted and the comment...

Anyway, while sex is indeed a very good one, any kind of intensive physical activity helps.