top | item 30473322

Ask HN: Any scientifically proven techniques to boost concentration?

288 points| amznbyebyebye | 4 years ago | reply

I feel like I have to be in a very specific head space to write code. It’s like climbing a big hill but in my head. Sometimes it’s effortless and sometimes it’s a slog.

Are there any proven exercises or techniques I can adopt that are proven to boost my ability to focus and get in that clear headspace to write code?

Edit: adding some tips as I try to figure this out. Note: not scientifically proven (to my knowledge)

1. Music. which type depends on the individual.

2. Timing. Dead of night or early in the morning when the world is quiet. Not this isn’t a muscle you can flex at any time, you have to just capitalize on the right time.

3. Long shower

4. Caffeine

5. Get out of the office/house go somewhere else (like a cafe)

6. Take a walk

7. Have a beer

8. Write thoughts down in a notebook without any phones/laptop in sight and then jump to the laptop to implement

9. Meditate

10. Lift weights / exercise to work the demons out and quiet the mind

186 comments

order
[+] jmalicki|4 years ago|reply
Exercise (mostly I've seen more intense than walking, but cardio like running, cycling, rowing, etc. - I haven't come across much for resistance training like weightlifting) has been very well studied to improve cognitive ability, as well as mental health (depression/anxiety). Depending on what you mean by proven, it's not gravity, but it's pretty good evidence compared to just about anything in medicine (just look at the numerous citations testing various aspects/study designs/different populations).

Just a few studies (there are countless): https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3951958/ https://pubmed.ncbi.nlm.nih.gov/20065132/ https://pubmed.ncbi.nlm.nih.gov/35153701/ https://ju.se/download/18.4662178a174aa5f82061c573/160103080...

[+] k__|4 years ago|reply
I also read creatine, while used mainly to improve gym perf, helps wirh cognitive ability too.
[+] Breza|4 years ago|reply
My work performance has increased tremendously since assembling a treadmill desk. The book In Praise of Walking delves into why it works.
[+] rthomas6|4 years ago|reply
Not joking: stop going on the internet. It's scientifically proven to boost concentration. More specifically, do one thing, and only that thing, for a set time period. Do not check your phone, do not even have it in the same room. Do the one thing until time is up.
[+] nine_k|4 years ago|reply
Since accessing the internet (and sometimes even the Web) is often a part of an IT job, the "one thing" approach is pretty helpful. Keep in mind what are you doing. If you're reviewing a pull request, you only need the Github page, and not the rest of the pages on the WWW.

Also, timeboxing things helps. It's hard to work on one thing indefinitely, it can even induce panic. But if you're using something like the pomodoro technique, you know that when you're feeling a craving to switch, you have, say, 27 minutes left until the next break. It's observable and manageable; you can concentrate during this time, knowing that a relief is nearing. But the relief (like going for more tea / coffee / etc) is also timeboxed, so you don't get distracted forever.

[+] hombre_fatal|4 years ago|reply
I've replaced a lot of my normal web surfing time with putting in some bluetooth headphones and listening to audiobooks. Much more fulfilling than spending hours on the internet where I can't even remember what I did that whole time, and you're freed up to do other things like work out, prep food, clean the kitchen, etc.

Not sure if it has improved my concentration, but it has improved all sorts of aspects of my life in surprising ways. Like I'm now the type of person who doesn't mind hand-washing all the dishes where, in my 20s, I'd let them pile up in the sink—I just do it while listening to a book.

[+] lewisjoe|4 years ago|reply
It works. I found myself getting distracted and one day I pledged not to switch tabs or panes when a programming task involves a pause, such as getting a new build. I'd either stare at the screen or switch to a related programming task. This brought out a tremendous difference in my concentration spans.
[+] lordnacho|4 years ago|reply
This is like saying "stop eating too much, you'll lose weight".

You have to eat and you have to use the internet.

What's the solution to not doing it to your own detriment?

[+] Cerium|4 years ago|reply
A few weeks ago I installed the browser plugin Intention on my workstation. It has been great, having a reminder that I am getting distracted and being given the option to be distracted on purpose for a limited amount of time.
[+] pingeroo|4 years ago|reply
Whenever I go on twitter it messes up my momentum for that whole day. At least that's how it seems.
[+] qznc|4 years ago|reply
Do you have a citation for the „scientifically proven“?
[+] throwaway4good|4 years ago|reply
Ha - true - but not the answer we are looking for ...
[+] gyulai|4 years ago|reply
Video game music is actually designed to increase your ability to concentrate on the game. I highly recommend listening to some as you're coding. You can get it at Bandcamp [1,2]. Trance music also works, especially Goa Trance.

Binaural beats [3,4] are also worth a try.

[1] https://bandcamp.com/tag/video-game

[2] https://bandcamp.com/tag/video-game-music

[3] https://en.wikipedia.org/wiki/Beat_(acoustics)#Binaural_beat...

[4] http://gnaural.sourceforge.net/

[+] nabusman|4 years ago|reply
Couldn't agree more, Goa trance/Goa psych is great for this. I usually throw on digitally imported [1] for listening and discovering new genres. My recent favorite is psydub and melodic house.

[1] https://di.fm

[+] csomar|4 years ago|reply
That might make some sense. I've been running Cyberpunk 2077 playlist when starting coding sessions. Kind of get me in the mood to start fighting. It might have helped that these audio clips have been mentally linked to real-life fighting. (in the game, of course).
[+] amiga1200|4 years ago|reply
There’s something to this. I’ve noticed an increase in heart rate, possibly a sympathetic reaction with the effect of pumping more blood to the brain? In any case it is not long before beat fatigue sets in and my mind is worse off.
[+] kaczordon|4 years ago|reply
Dr Huberman from Stanford has a great weekly podcast where he talks about how to improve all parts of your body/mind for various activities(sleep, exercise etc.). Here’s one on improving productivity: https://youtu.be/Ze2pc6NwsHQ

One of the tips from the video that I really love is called the cathedral effect. It was found that having high ceilings increases your creative capacity when doing an activity.

[+] endymi0n|4 years ago|reply
Just joined a Flow Working workshop by Dr. Antoine Larchez and had some interesting results. As a lifelong (functional) procrastinator with diagnosed ADHD, I brought down 2.5h of effortless (once started) work on paper, some of the best in a couple of months if not years.

I have yet to see whether the methods are scaleable and replicable for me, but a lot of the content resonated with me, especially the insight that concentration to flow states is a skill that can be learned and brought down from 20 minutes to just one with training.

It was an interesting mix of fundamentals from Cal Newport (Deep Work), plus mind emptying exercises, concentration meditation, exercise breaks and group work sessions.

I'll probably dig more into it.

[+] reactspa|4 years ago|reply
What did you do different to get the 2.5 hours of uninterrupted work done?
[+] 71a54xd|4 years ago|reply
As someone who also has adhd and is a functional procrastinator at times saboteur I'm curious if you could elaborate on your "mind emptying exercises"?
[+] dzink|4 years ago|reply
A couple of things to add to your list:

Go to bed early - 9-10pm and wake up when your body feels like it for a change. If it’s 4-5 am, you get more hours of dark and focus time and your brain is at peak executive thinking, so you can see the bigger picture and write much wiser code.

Fasting for a bit may keep your focus as well for a while. If you wake up and are distracted from hunger, drink a cup of plain while milk or plain yogurt. The protein and fat will be an instant boost to your brain and you will stay focused until you get hungry again. If you keep to meat, dairy, or sugar-free protein and fat you kan keep your focus all day. Carbs will crash you.

When you feel tired or unfocused, or ready to go to social media, take a nap instead. You can eat some carbs now as they can help you fall asleep faster. When you wake, apply the same principles.

I had to work for my own startup for a while and a squeezed a whole bunch of top quality code out of my brain. Without enough sleep or quality fatty protein, the brain gets distracted more easily or operates only at lower levels of abstraction.

[+] arnejenssen|4 years ago|reply
Yes. Fasting can get you into ketosis, which can enhance focus.

Avoiding carbs and sugar prevents insulin spikes and that prevents "brain-fog"

[+] vedran|4 years ago|reply
A few more from Dr. Huberman:

ADHD & How Anyone Can Improve Their Focus - https://www.youtube.com/watch?v=hFL6qRIJZ_Y

How to Focus to Change Your Brain - https://www.youtube.com/watch?v=LG53Vxum0as

[+] dominotw|4 years ago|reply
I've tried to listen Huberman so many times but have hard time focusing. He seems to rattle off a list of things without any emotional hooks to keep the user engaged.
[+] Graffur|4 years ago|reply
I am only 2 mins into the first video but I am hyped - thanks for posting this!
[+] tkgally|4 years ago|reply
I’m not sure if it makes sense to try to find a “scientifically proven” technique if all you want is something that works for you. What works for a large group of people in a controlled scientific study does not necessarily work for each individual in that study, let alone for you.

You could do a scientific study on yourself, though. Figure out some objective way to measure your own concentration, and then try various interventions one at a time to see which intervention correlates with the best concentration. You could also try combinations of interventions—having a beer while taking a shower?—to see if you can get an even stronger effect.

I’ve never done such an experiment on myself, as planning and implementing the experiment would distract me so much that I wouldn’t be able to concentrate. So I just exercise for a while every morning. That seems to work—for me.

[+] k__|4 years ago|reply
I think, what most people want is a pill that makes them less distractable.

Ritalin is that pill. I know a bunch of devs that take it to code through the whole night.

But...!

1. It usually requires a prescription.

2. While it lets you hyper-focus on one task for hours, if you not careful that task could be rearranging your cutlery.

[+] mannykannot|4 years ago|reply
I can only speak for myself, but the only thing that boosts my concentration is to buckle down and concentrate - which rules out most of the above. It usually takes a couple of hours before the effect is noticeable. (I'm not claiming to be good at it, but I have learned what works for me.)

The other thing is to notice when I am no longer able to concentrate any more, as it is no longer productive to keep going. When that happens, any of the above might be helpful, but that list is missing the most important one: get enough sleep.

Your list is mostly of solitary (or not explicitly social) activities, but socializing is also helpful for me.

[+] jmcgough|4 years ago|reply
I've found that reading helps a lot, even if it's difficult to maintain the focus at first it gets better. My brain was so hooked on the dopamine hits of constant online chat, phone notifications etc. Now I wake up and read a book for an hour before starting the day (I turn off phone / laptop and put them in a drawer) - it makes a big difference.

I can't find relevant studies, but there's a few scientists who say that reading improves focus: https://www.ncu.edu/blog/reading-improves-memory-concentrati...

[+] seer|4 years ago|reply
Fast. Like more than 48 hours water only.

First of all it kinda puts you in this “survival” state where while not feeling hungry per say, you’re on high alert and can concentrate like crazy.

And after you finish you feel rejuvenated and excited. Amazing experience and can’t recommend it enough. Done it several times already (4 days fasts) and still having the same initial effect.

After listening through all of the science in Lifespan (the book and the podcast) have started the “only eat in the evening” routine. Like I skip breakfast and lunch.

Still in my first week so its kinda hard, but after another week or two my glucose levels are supposed to stabilize and I would not be feeling the pangs of hunger and highs and lows of sugar spikes after a meal and brain fog after the insulin response has sucked all of the sugar from my blood (and brain).

Its that what I’m really after - steady brain performance throughout the whole day. Will see if I adapt and that actually happens!

[+] winrid|4 years ago|reply
This is what I do too! I do only dinner two days a week, no other meals on those days. Must work, I built fastcomments this way :)

Also naps! 20min naps are a nice reset to fix concentration issues. I wrap my head in a blanket so I fall asleep fast and set a timer.

[+] Broken_Hippo|4 years ago|reply
Disclaimer:

Before going to a water fast, especially for a 2 whole days, talk to your doctor. Not everyone can fast, even for shorter times, and you might not know you are in that group. Ancedote: I have a friend that was hospitalized for doing a much shorter fast - daytime fast for religious reasons. As far as he knew, he was healthy enough for it and he was young at the time.

[+] maartenpi_|4 years ago|reply
I have done intermittent fasting, but I lose too much weight while doing so. I really liked the benefits. Especially fasted cardio feels so good.

I'm already fairly slim (1.90m and <80kg) and become a complete stick man after doing this. Anybody know how to do this and how to stay in shape at the same time.

[+] dasil003|4 years ago|reply
Based on consistently feeling as you describe in your opening sentence for over two decades in many different life stages and concept, let me suggest a reframe:

The good news is that "sometimes it's effortless". Consider yourself blessed. For a lot of people that is never true and though they may even achieve some professional success by grinding, it will be joyless and likely not lead to real career satisfaction.

Now in terms of optimizing your coding output, don't focus on minmaxing this as if you were an assembly-line manager trying to squeeze out your next ounce of performance. Instead recognize that coding is a creative craft that depends hugely on your state of mind. Focus on finding ways to recognize and harness the energy overall, but recognize you can't force it. This comes in two parts:

First, if you are procrastinating diagnose that by practicing self-awareness at all levels. For me it can range from something as simple as eating the wrong lunch all the way up to existential crisis about how I'm living my life, and everything in between. This is obviously non-trivial, but it can be hugely important. A lot of folks mention exercise here—and I agree—but I would broaden it to include ones overall physical and mental health. By addressing those things holistically one establishes the conditions to allow inspiration to strike.

Once that is established then you need to recognize and harness the energy when it comes to you. It might be on a schedule, it might not. You might have an understanding boss who gives you carte blanche to organize your own deliverable schedule, or you might need to some stakeholder jiujitsu (up to and including finding a new job) in order to carve out space to make your process work for whoever is putting money in your pocket. The point though, is not to adopt some external productivity narrative (I was brought up with the puritan work ethic) but to instead recognize and optimize for the tao of your own abilities.

[+] nnf|4 years ago|reply
I used to avoid music with lyrics, but (for me anyway) I’ve realized I can concentrate just fine when there are lyrics as long as I’m listening to songs I already know. I usually put on a playlist that’s maybe an hour or two long and just let it repeat all day.
[+] philipswood|4 years ago|reply
Action movie and game soundtracks tend to be great for this.

I suspect it’s because they needs to have an emotive effect without distracting you from the story.

[+] PragmaticPulp|4 years ago|reply
There are many incremental improvements that can make a small difference, but in my opinion the most important thing is to optimize your environment first and foremost.

One of the most effective strategies I've learned isn't necessarily cheap, but it works: Get two computers. One is your work computer. You only work on it. One is your play computer. You only play on it. If you struggle with self-control, use extensions to block or limit your time on sites like HN, Reddit, Twitter, and others on the work computer.

For me, physically moving between the two computers helps reinforce the separation. If visiting HN is an alt-tab away, it's easy to drift off when there's a lull in work or I have to wait for a compile. If I have to actually get up and move to waste time, I will put deliberate thought into it and, most of the time, not do it.

If you have the space, creating a separate home office that is in a different room from your play computer is golden. That's a lot to ask, obviously.

For a more accessible alternative, consider isolating your distracting activities to only your phone. That's what I do most of the time. I only use the phone distractions while I'm walking, which helps wake me up in the process.

[+] graphpercolator|4 years ago|reply
Totally agree. I even go with three. One work gave me, one for my own hard mental work and one for everything else.

For me, I am just not going to play on my personal work computer after going through the trouble and space to set all this up.

[+] btgeekboy|4 years ago|reply
I’ve gone the caffeine route before, and it works but only until the crash. The heart palpitations aren’t worth it, IMHO.

I’ve had a subscription to Brain.fm for a bit over a year now. Supposedly it doesn’t work for everyone but I find the act of picking a 60 minute Deep Focus block, probably just as much as the music itself, really helps me keep my head down.

[+] grahamplace|4 years ago|reply
I’ve found that sometimes I need some accountability / social element to help me actually accomplish work. It’s also related to point (5) about going somewhere else, or as Cal Newport puts it, doing a “grand gesture” to signal to yourself that you value getting the thing done, and now you’ve incurred some cost to set yourself up, you better do it.

To help achieve this effect while working remotely, I’ve used https://www.flow.club/ and recommend it

It helps you: (1) actually block time off in your calendar to do focused work (2) set your intention for that chunk of time (3) create an accountability mechanism by telling the people in your session your goals (4) creates cognitive dissonance if you let yourself get distracted (since you told people what you would be doing, and have to tell them at the end of the session what progress you made)

[+] anonyfox|4 years ago|reply
In my experience, the first step is to get the physical basics right (sleep, exercise, nutrition/hydration). This is already hard for most people, but can bring you to 100% of your theoretical mental performance as the baseline.

To go beyond that, a daily routine of 2x20min meditation is somewhat proven to increase your mental capabilities slowly over time.

Also background Music (like Trance or game soundtracks) have some instant effect, I personally have great results with Endel.io - highly recommend!

[+] meken|4 years ago|reply
I don’t believe it’s scientifically validated, and I don’t have a direct link off hand, but check out Trataka, which is staring at a fixed object for a set amount of time (e.g. a candle or an image with a dot).

HealthyGamerGG YouTube channel has videos on it.

Apparently the yogis have been doing it for 1000s of years.

[+] ultrasounder|4 years ago|reply
Netra Trataka to be specific(Netra- Eyes). My dad has been practicing yoga for the last 30 odd years(he is 75 this year) survived a near fatal Heart attack(occlusion) but doing well now with the help of couple of stents and Yoga!. This stuff works. For the real.