Hacker News new | comments | show | ask | jobs | submit login
Ask HN: Does coding give you brain fog?
71 points by shaydoc 66 days ago | hide | past | web | 69 comments | favorite
Do you ever suffer from brain fog after a day of intense thinking/coding ?

Some days after intense working I leave the office spaced out, to the point I wouldn't drive. Thankfully I hop on the train.

I also find the whole prolonged screen exposure and posture just leaves me with a headache and neck ache.

I really notice how much better I feel after maybe 3 days off work..




Not exactly brain fog but I often find myself in extreme left-brained mode after a challenging day of coding. If I meet friends after work I am a horrible conversationalist for up to an hour while my brain slowly (and reluctantly) stops actively churning on coding problems.

Related to the right-to-left thinking mode changes, sometimes the words that I am using at become eerily meaningless or unfamiliar. I've spent a few moments asking myself "is that really the way 'else' is spelled?". I recently learned this phenomenon is called semantic satiation [1].

[1] https://en.wikipedia.org/wiki/Semantic_satiation


Left-brain mode after coding all day is certainly a thing.

I thought it would go away once I got into management, but the truth is I solve those problems with the same analysis, so even though I'm problem solving people, I'm still a horrible conversationalist right as I leave work.


Oh yeah! I have had that phenomena pop up on occasion. Didn't know it was a thing.

It isn't a result of repetition for me though. Since I have practiced meditation enough, I can watch how my consciousness shifts and changes. I remember watching a creeping doubt enter, and then a word loses meaning, or I'd forget how it is spelled, even while staring at it. Knowing that jusf a few seconds ago, I knew what it was. I also chalk it up as a state change. I sometimes google it just to be sure and if it shows up, let it go and move on. I don't remember if I ever tried sitting through and seeing how the consciousness shifts back -- would be interesting to watch what happens.


Oh yes, this is the worst part of programming. I do not like being low on empathy.[0]

Metta meditation helps to reset this but sometimes it's so heavy – it's better to take a nap first.

[0]: http://blog.case.edu/think/2012/10/30/empathy_represses_anal...


I've been experiencing language difficulties since I started programming more, usually during the workday, when I'm actually working on the code. I thought I was going crazy, but it sounds like you have similar experiences. Is this somewhat normal?


Yeah, I noticed I have trouble conversing or paying attention to what the person is saying to me, particularly if the talk isn't geared to resolving a problem.


I used to get this - it turned out that I was not breathing enough, which caused my blood pressure to go up. I would get so focused on a problem my breathing would slowly become more shallow.

Now I have a water bottle on my desk and I slowly sip it all day, it forces me to get up every 1-2 hours to use the bathroom and fill the bottle back up -- and I deliberately use the bathroom 1 floor down to force me to go up and down the stairs


> I deliberately use the bathroom 1 floor down to force me to go up and down the stairs

This is such a good idea that I'm stealing immediately.


I also visit the office kitchen 10 times a day, fill up a glass of water and go back. I don't necessarily finish it, next time just spill the remaining and refill. I believe developing these habits helps avoid burning out and other desk work consequences such as RSI.


> next time just spill the remaining

Get plants! Take the responsibility to water them. You will have another reason to walk around the office!


thats a cool idea actually


Years ago when I was just getting into the film/EFX industry, a grizzled old vet told me "when you're in production, drink lots of water because otherwise you'll never get up from your desk"


Hm, my breathing also varies somehow when I'm thinking. I'm not sure of the details, because it never happens when I'm thinking about my breathing!

I've occasionally pondered obtaining some kind of fitbit for lungs to see if I can spot said 'variation' on a graph. I'm not really sure I'm not just making it up.


I've had the spaced out feeling after work as a recurring problem for over a decade. Most days I am OK enough, but others the only thing I want to do is go home and stare at a wall as all cognitive abilities are exhausted.

I run 10 miles a week and bike long distances, make all of my own meals, and have been working with various doctors for years. Nothing seems to help 'fix' the issue altogether.


I am the same, been like this for years. I recently cut out coffee and it's helped a little.

What I also find is my heart is always at its lowest at around midday.. drops to 49/50 before lunch.

I get up several times in the morning and walk around, but if I get in the zone with a problem I am always spaced out By the end of the day


I used to come home and slug a glass of wine or two down. Felt better fast but early in the evening I was tired. Now I just get quiet for a few minutes and then let the brain be what it is. My fog goes away more slowly but I have energy and clarity till I go to bed. In short I think the benefits of not drinking after work are better than if I was drinking. YMMV.


Aye I had to give up drinking last year. It worked wonderfully for a while.

You reminded me, I might try employing mindfulness more again. Let things be as they are for a bit. Thanks!


Yes mindfulness is helpful.


I've had a tendency of entering prolonged periods of focus throughout my life, and at this point I can feel my brain almost optimize to the task at hand, there is a type of shift.

For example, I played and performed music seriously for a period of time (no singing), and it was pointed out by a close friend that any performance that lasted more than an hour and my verbal center would basically crash. It would take at least 30 minutes or even hours before my brain would be able to start talking like a normal person again. Prior to this point in time I had purchased a pocket dictionary which I carried around, seemingly to combat this issue.

At present, when I have been working on something particularly engaging at work my wife notices because my ability to communicate does suffer.

It is interesting that you noted 3 days, just because I recently heard a researcher talking about how getting away for 3 days can have a cognitive benefit: https://www.rei.com/blog/camp/the-nature-fix-the-three-day-e...

As was mentioned, getting checked out by a doctor does sound like a prudent step.


I get a bit awkward socially after a focused stretch of coding. Some days I'll go 4-6 hours only speaking to one person (a barista) briefly to order some coffee.

The next conversation I have after the coding stretch usually finds me struggling to make my mouth say the thoughts in my head, and then once it does, the sentence structure I use includes more nested clauses than usual.

But even after a 12 hour day of coding I rarely feel fatigued when it comes to learning something new about a technical area I'm studying, though admittedly I don't always spend my spare time working on those things.

I generally get very focused and periodically hours will go by and I won't realize what time it is, only to realize that it's hours later than I had thought. This is a double-edged sword. The flow state is amazing, but sometimes I wonder what happened to the day, even though it was a pleasant day.

I'm about half introvert, half extravert, but for me the most fatiguing thing is being in meetings that seem to last too long relative to their yield. I end up drained and need to recharge for a bit afterwords alone before I'm ready to do anything.


Please get checked out by a doctor. Anytime you have really weird symptoms, it's best to be sure it isn't something serious.

Short answer: No, I've never had anything like that.

After concentrating for an extended period, I'm slightly out of it when switching to talking to someone. But it clears up quickly and has never been anything so bad that "I wouldn't drive."


I do, but I also have fibromyalgia, which makes me an atrocious point of comparison. But that does mean I've gotten a lot of experience working around physical and ergonomics engineering.

Intense mental work can drop your blood sugar and oxygen content in your blood, as mentioned by others. Start checking your health and engineer health back in for better coding.

Walking to another floor's bathroom, stepping away from your desk to walk around the building, getting a sit-stand desk, regularly stretching... there's a bunch. Get a tracker, and start experimenting. The same thing for nutrition.

If you haven't, work on deep breathing exercises and consider getting a pulse tracker so you can find a pattern. This is any other data pattern, the effects are just very close to home. If you feel like you should be coding, consider if your life was a resource management game and at what point you would expend resources to get better productivity from your base unit (aka. you).

Good luck!


I get this if I spend too much time programming. You just need to get up and take breaks, for example after every task you complete. Go do stretching or read a book, let your mind unwind, then get back to it after 20 mins. Not all offices allow for this so if yours doesn't consider changing job, for your own health.


A lot of people here are saying take breaks and go for walks. I've felt what you described and something that I have just recently started doing that has helped 1000x over is meditation.

Check out the Calm app[1]. Its helped for me because I had no idea where to start. I have no affiliation with them and am sure there are alternatives out there, this just happened to be the first I had tried. I've just started using it the past few weeks and use it at least a couple of times during the work day, and I try and take a walk at least once a day during work as well. Its really helped with everything you listed above.

[1] https://www.calm.com/


You need to set reminders to take a break once an hour, walk around, stare off into the distance for 5 minutes. This article is from 2012 but mentioned 5 of them: http://www.techrepublic.com/blog/five-apps/five-free-apps-to...

I also noticed this was a side benefit of having a good test suite- if your test is valid, thorough, and passing, then you don't have to remember as much mental-model (because it's encoded in the suite), which would normally discourage you from getting up at all


I actually built something like this for myself when I was learning javascript. It's buggy, but for the most part it works. http://okpeet.com/breaktimer/ if anyone wants to take a look.


Heh, I also made a chrome extension for the same thing and with the same name! https://chrome.google.com/webstore/detail/break-timer/hklkdb...


nice! i'll try it out. solid name


It's all open source - https://github.com/tom-james-watson/breaktimer

I haven't had much time to work on it for a while. Contributions are very welcome!


I made myself a pebble app to do this that I never ended up publishing. Sadly I no longer have the code nor my pebble.


Coding just burns me out. By the time I get home, I can't bear to even look at my laptop. I have a very hard time doing coding side projects because I'm just to burnt out too code outside of work.


Its all about having a work-life balance. I code in the morning, then work-out in the evening.

The workouts keep me healthy and makes my brain active during coding.

And writing code creates the mental concentration which has built up my mind-muscle connection.

Both go hand-in-hand really. Never do too much of anything. Too much of writing code drops the code quality. And too much of physical exercise will not allow for muscle recovery. Just apply common sense and do what feels right to you.

And yes, buy a good keyboard. A really good one. It will help you years later.


You should check calcium, vitamine D. and parathyroid hormone levels and consult a physician. Brain fog is typical for elevated levels of calcium. I had a thyroid cancer which affected parathyroid glands (rare) and had a brain fog for like a couple of years before being properly diagnosed. It is nasty because it affects your emotional and intellectual abilities but it is difficult to self-observe.


I'm under a tight/looming development deadline during the day and remodeling the lower level of my house at night. I find after prolonged mental strain during the day, I find it hard to do basic math with fractions to do simple cuts of wood (5-3/8 minus 2-1/4)...uhhh...


Could be that you over eat or under eat while working. Or are snacking on something you have a food allergy to. Could be that you're not getting enough exercise. Could be an environmental factor like mold. I've had all of these issues at one time or another resulting in brain fog.


I started having that during my PhD, and I got into a mild alcoholic habit because of that. I was so brain-tired at the end of the day that I felt the need to "reset" it with a couple beers. Mind you it worked great, but I definitely recommend against it.

I find physical activity (walking, biking, going to the gym) to be the best, with the added benefit of the "Eureka" moments you get when you're NOT at your desk. I now try to go for a walk for at least an hour if I start getting that. It took me some time to find a job/boss who understands that.

So yeah, it happens to me every time I concentrate too hard for too long, especially when coding / working on logical problems.


I usually get this after a stressful day but not to the extend of what you are describing, it lasts for ten minutes or so until I change environment. Do you consume a lot of caffeine while working? Maybe you should check that. Taking breaks every half an hour is always a good thing, never be stuck on the office chair for too long, it causes problems even if there's no underlying health problem. You don't need to run a marathon either as far as exercise is concerned,if you have the chance get down and do 15 - 20 push ups a couple of times a day, it's amazing how much difference it makes. Taking a walk also helps clear your mind, I feel really relaxed after walking my dog for 30 mins.


No, but it could be that you are stretching your skills(good!). Exercise to make sure it's not a physical thing, and be sure to take regular time off to recover.

If you are working on challenging stuff all day, it's probably a really good thing.


Could just be simple brain exhaustion from prolonged concentration (I occasionally feel something similar, usually after back to back heavy coding days and I'm running low on sleep).

Like others are saying, a few things that might help: stay hydrated (water, not coffee/soda etc.), get a good night's sleep ahead of intensive coding days, don't eat crap food at your desk and don't stay in the "zone" for 6+ hours without getting off your chair at least once and doing something different for 30-45 mins (ideally involving fresh air, outside of the building).


So much genuine amazing feedback, thanks so much..

I have been doing this job 20 years now and I think this feeling is more prevalent now. The combination of family, commute, and sitting at a desk coding is frankly tiring.

I often get up and walk around, and drink water, etc.. I cycle to work often, used to do gym sessions at lunchtime And that definitely helps..

But sometimes when you are thinking intensely you just zone out...

I used a little poetic license regarding "I wouldn't drive" just to get my point across.


I experience something very similar. It turned out to be at least in part from eye strain induced headaches ("computer vision syndrome"). I started paying more attention to ocular health, including following the recommendation of a comment here [0] and lowering screen brightness. It does seem to be helping.

[0] https://news.ycombinator.com/item?id=12582810


Sometimes.

If I am marathoning, though, I use a pomodoro timer and meditate or do something similar to tai chi in between coding sessions. If it isn't that intense, I tend to self-regulate in microdoses using techniques from meditation and an art like tai chi.

I only require multiple days of recovery when I burn out, often resulting from sustained interpersonal conflicts. I have noticed that has been improving since applying techniques from Crucial Conversations.


I don't feel brain fog, but I have hard time playing tactical videogames on intense work days. In those cases, I play a very reflex based game and it feels like doing a relaxing run after hard training


On the body aches - standing desk that can lower to sitting height. I change back and forth throughout the day. Also keep a bokken (wooden sword) to swing and walk for periodic breaks - wife calls it my "thinking stick".

Regarding getting out of the fog - drinking is the only thing I've found to be reliable, but seldom do so during the week


My main problem was eye fatigue. I use Flux (justgetflux.com/) set at 4300K even during the day, and it helped a lot.


My first couple years as a professional developer were amazing - 7-12 hours a day of coding to keep up. Every single day I left the office totally spent mentally.

I would often dream about coding, or solving a problem that I was stuck on.

I did not however, get headaches or neck aches. In fact, I found being spent mentally to be somewhat of a pleasurable state!


You're straining your brain over extended periods, of course it happens. Your brain is a living part of you and it too needs to rest. I get that semi-often partly exacerbated by bad sleeping habits (it's not good obviously) and I what I find helpful is to take breaks and drink more water. Sounds obvious but yea.


Yes. I'm sprawling on a bench now after hours of coding, I should be on my way home. The top of my head feels like pepper was poured on it. I can't really endure a conversation at the moment. I believe it's a combination of sleep deprivation and hours of intense mental exercise. Listening to music helps


I would definitely look at the ergonomics of your work environment. Do you work on a laptop all day? I don't know how people can do that, it is terrible for your neck and back. Something like this could be causing (or contributing) to your fatigue as much or more than the intense thinking.


I have workrave installed on my computer. It reminds me to rest my eyes, take long and short breaks throughout the day. I installed this on my computer after a few days of being terribly tired at the end of the day. Now I feel better and fresher even during the day at work.


I have only rarely have felt this from programming (at work or not).

But as a competitive chess player, I do usually experience it at the end of (especially) weekend tournaments, where there is generally 3 consecutive days of 8-10 hours of intense concentration. The fog is gone after a good sleep and day of rest.


Yes, exactly this! Sometimes on my drive home I think it's not such a good idea to be behind the wheel.

It's usually a combination of long days of coding and stress that causes my brain fog. The same factors cause me to regularly wake up at 3a.m. with my mind too busy to go back to sleep.


I experience these symptoms from work days during prolonged periods of high stress. I don't usually get it from programming during less stressful times and I've had just the same issues during a month when I somehow ended up with a bunch of non-programming tasks.


Oh yeah! My friend used to tease me every day after work when we worked together. "How's it hanging up there in the code fog" he would always say when I was grasping for words :) I never really noticed though: so no headaches or anything like that...


No, rather the opposite. Coding makes my mind clearer. If you get a headache and neck ache, then that is most likely due to poor ergonomic setup. Things like better chair and sitting right should help. Or perhaps you need terminal glasses.


Do you take brakes and walk around? Do you exercise (I mean RUN) while not programming?


> Do you take brakes and walk around?

That's a novel approach to exercising.


Sounds like a farmer's walk to me.


breaks :p


I'd second this comment. I found lack of movement to be the problem for me. After several hours in front of the computer coding, browsing, whatever, I'd find myself feeling zombie-like and brain-fogged. I got inspired by the Walk and Code blog post[1] and bought a walking treadmill for work. Bye-bye zombie feeling.

I work in an open office environment, so I needed one that was quiet. I bought the Rebel Treadmill 1000 and it's so quiet me and my office mates can hardly hear it over the sound of the HVAC system. Not affiliated with the company that makes them, but I heartily recommend their treadmill if you get in the market for one.

[1] https://8thlight.com/blog/doug-bradbury/2010/02/25/walk-and-...


Have you tried cutting caffeine? I've had similar symptoms and cut coffee two weeks ago after drinking > 5 cups/day for years. Not sure if it's placebo but it looks like my brain fog is gone.


After a day of intense coding, I am completely hosed when I get home. I find programming to be very exhausting and demanding.

If I'm just doing easy front-end stuff like css, I don't feel this effect.


Look at the act of coding itself. But also look at your overall work environment. It could be the stress of focusing in the face of distractions. It could be allergies. Or bad lighting.


Check your light, seating & posture, chronic muscle tensions, and most of all diet. Thinking burns calories, your brain gets something like a fifth of all the oxygen you take in...


Possibly eye trouble, bad air in the place where you work or a latent health issue.

I used to get incredible headaches after long bouts of coding, it took me a long time before I realized I needed glasses.


>it took me a long time before I realized I needed glasses.

I'm rather astonished how relatively poor my eyesight had become before even thinking I might need glasses. Boil the frog, I suppose.


Yep. And it's not as if I needed the hint, most of my family wears glasses. It's just that it changes ever so slowly day-by-day and then one day you wake up with a headache so bad that you can't see at all. Getting reading glasses was a major improvement in quality of life.


I have used the Pomodoro Technique to help me here. After 25 minutes work get up and walk for 5 minutes.

Adjust duration and ratios to suit your own environment.


I always get brain fog while at work or school, and it always dissipates when I go home. I haven't found a direct cause yet.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: