Managing Brain Fog When Programming
Have you ever been working and felt like you just cannot work through some logic, or you may even feel physically exhausted? I know it has happened to me very often. What do you do when that happens?
Brain fog is something that I deal with on a daily basis, but it can be managed and the effects can be reduced significantly. Here are some of the most important tips I’ve discovered which keep me going.
1. Work in intervals.
Alright, so usually with these lists you give the best tip last, but this one is so important and it really ties into the rest of this list so pay attention!
One of the best ways to overcome being stuck is to give yourself regular breaks. Now these breaks need to be a context shift. In other words, you should be leaving your desk, doing some stretching, and overall trying to let go of the problem at hand.
This is similar to sleeping, in that it allows your brain to subconsciously process the work that was just done, and MANY times a possible solution will just pop into your head. This has happened to me many more times than I can count.
Working in pomodoros is great. I used to do 25 minutes of work, followed by a 5 minute break. This is a good starting point if you have never tried Pomodoros, or if you find yourself losing focus often. Recently, however, I’ve moved to a 50/10 cycle as my optimal amount, especially coupled with the scientific focus music from Focus @ Will
2. Eliminate Distractions
Work is very similar to sleep, believe it or not. What do I mean? Well, in the same way that your quality of sleep is greatly diminished if you are woken up or disturbed, the quality of your work and focus is affected similarly. .
Have you heard of being in the state of “flow”? Well, the more uninterrupted focus time you can manage on a particular problem, the easier it will be to avoid getting bogged down with that feeling of brain fog.
Try turning off notifications during times of the day that you designate as your “focus” or “work” time. Overall, it’s important that you chunk your time into singular focus segments because we as humans do NOT work well when multi-tasking.
3. Focus on ONE thing at a time
Just to reiterate what I mentioned above, ideally you want to clear your mind of everything but the one task at hand.
Maybe you have a todo list of 20 things that need attending, but you can’t deal with that all at once so what is the point of thinking about it. Put everything you’ve got into completing ONE thing at a time. Ignore everything else, and you will find that these tasks become so much easier.
4. Break up large tasks
Sometimes we give ourselves these monumental chores, and this creates a sense of overwhelm, which then can lead to brain fog.
Building a pyramid was probably quite the job, and just thinking about how to get it done would have been mind numbing. Similar to any programming work, however, it all just comes down to breaking it down to the smallest parts and building it brick by brick.
Don’t allow yourself to become overwhelmed by the magnitude of what you have to get done. Make it as simple as possible.
5. Have a very clear plan
Working on small tasks one at a time is great and all, but sometimes when I don’t have an obvious path of what I’m doing, that weighs me down quickly.
Even if we don’t realize it, our subconscious is always trying to figure things out behind the scenes. The more crap you can remove from “what I need to think about” the better.
In other words, what I’m telling you is that the less you have to think about, the less likely it will be that you go into that brain fog state.
A lot of what I’ve written about above can be accomplished by writing down and managing all of your tasks in some way or another. Whether you use a GTD system, or any other productivity method, it doesn’t matter. Just have some way of planning out your day, week, or even month.
There is a reason why Trello cards for managing projects has become so popular! If you need some ideas, I made a great video a while back about my Kanban productivity workflow.
6. Code during your optimal time of day
Being aware of your own natural rhythms can be really powerful. Try to track the time when you seem to be most productive and start moving your important and challenging coding to that time of day.
Now I’m personally under the belief that we have a finite amount of energy and focus available to us for the day after waking up, so I do my absolute best to take care of the MOST important things as soon as I wake up, before I even allow myself to read e-mails, or do anything at all.
I notice that my energy drops off heavily after a meal, so I eat once a day at the END of the day. (for those of you freaking out, see the Warrior Diet)
On the other hand, I do recognize that many people do great as all night coders. Everyone is different, and only you can identify your most productive time. The main idea is to track, and make adjustments accordingly.
“What gets Measured, Gets Managed.” - Peter Drucker
7. Context Switching
At times, we are just faced with a really difficult problem that is inevitably going to put us into a state of brain fog.
If you find that even coming back from a break you are still unable to get past an issue, then you may need to do a context shift for a bit.
If this is a creative problem, try doing some logical or physical work for a little bit or vice versa. If I find that I’m stuck on a particularly complex issue where there are a lot of moving parts that my mind has to hold on to, I’ll take some time to do more design work, or writing.
This is similar to working in intervals, but really allows that one part of our brains to recharge while remaining productive by utilizing and working out all areas of our brain.
There is a lot more that could be said about this as an overall learning strategy in life, (working out all areas of your brain) but I’ll leave that to another post.
8. Train your mind
Alright, so I am an AVID listener of podcasts and other personal development material and what I’ve found after listening to many interviews of successful entrepreneurs and high achiever’s is that, a large majority of them all have one thing in common: they all practice some form of mindfulness or meditation.
Now, this isn’t meant to be a religious thing because I can’t stand all of the “woo woo” talk behind some of this stuff that you hear about.
There is some scientific proof, and some logical sense to the idea of building up your focus muscles by teaching yourself to clear your mind and focus.
To recap on what I’ve said so far, brain fog happens when our brain gets overwhelmed and we lose focus. We only have so much “fuel” to deal with the stream of thoughts coming in every day, so being able to let all of that go and focus on the present moment is extremely valuable in practice.
Anyone can do this, you don’t have to go off and be a Buddhist monk to be mindful. It only takes 10-20 minutes a day.
If you want to get into meditation slowly and easily, which I highly suggest you do, I recommend beginning with the Headspace app.
9. Healthy Body = Healthy Mind
I’ve left this one for last, because honestly, I would be able to write for days on the subject of health and I’ve timeboxed a certain amount of time to get this article written.
I don’t think I need to push too hard to convince you that being in great physical health has a great impact on your mental state. If you didn’t know this, well now you do?
Here are just a few closing tips to give you an idea of what to think about when it comes to physical improvements that will help you perform at a higher level.
- Get exercise of SOME sort in. Running, biking, lifting weights, it doesn’t matter. If you can’t hit up the gym, try doing some squats, pushups, or just walking around a bit during those pomodoro breaks.
- Try teas for less of a crash, and/or drink your coffee slower.
- Eliminate sugar and carbs. Breads, sugars, pastas, and grains will all create brain fog and lower cognitive ability, and are VERY unnecessary in a healthy diet.
- Healthy fats are the way to go for sustained energy / brain function. Try to consume more Avacados, Coconut oil, Fish oils, Organic 100% butter/cream (great in coffee), animal fats.