Live data from Hacker News

Ask HN: I lost my ability to focus for hours on coding. How to regain?

news.ycombinator.com

51–60 of 127 posts

Re: Ask HN: I lost my ability to focus for hours on coding. How to regain?

#52
post #14

This is a common problem. The book Deep Work goes into it in detail, and has some research-based techniques to fix it. Basically it boils down to removing distractions, and determination, gradually building up your brain's ability to focus again. https://www.amazon.com/dp/B00X47ZVXM

I would add that _almost anything_ that requires focus for a period of time can actually help you out. This book talks about the benefits of learning to memorize a deck of cards - just you and a deck of cards in the morning (no phone, no computer), can help "repair" your ability to focus.

Re: Ask HN: I lost my ability to focus for hours on coding. How to regain?

#53
It’s a vicious cycle.. the more you distract yourself, the more your brain wants quick hits, so you feel the craving for more distractions. There are many ways to help outlined by other comments here, getting exercise probably one of the most effective. However any solution will involve you making a conscious effort to pull out of the cycle and change your habits.

Re: Ask HN: I lost my ability to focus for hours on coding. How to regain?

#54
post #37

Earlier quoted context omitted.

Yep, good underground techno mixes at 125 or higher bpm can give you the drive and concentration you need for extended periods of time. My coworkers usually get a slight shock when they learn what kind of music I have in my headphones during work, being a 50 year old guy :)

Do you have a public playlist?

Digitally Imported is pretty great. I've subscribed for years alongside Spotify and prefer it for set and forget playback of a genre of electronic music. Spotify is for specific playback and discovery.

There may be a free trial, and I think there is a free tier with ads if you can tolerate them.

Re: Ask HN: I lost my ability to focus for hours on coding. How to regain?

#55
I'll probably catch some flak for this, but if this is just a short term hurdle during a single project get your hands on some adderall. If it continues for more than a couple weeks even when you're working on something you are passionate about put the pills away and take some time off away from the keyboard to try to decide if this is an issue of focus and distraction or just burn out.

Re: Ask HN: I lost my ability to focus for hours on coding. How to regain?

#56

There's a lot of factors that might go into this. If you're hungry, sleepy, undersocialized, unkempt, unfit, depressed, in a loud, messy, and distracting office, with unclear and unexciting goals, large monolithic tasks without clear breakdowns on how to move forward, constrained by slow tools, management, or blocked on dependencies... well, it'd be no wonder you wouldn't want to work! Eat well. Sleep well. Exercise.…

I just want to add that coffee can make you feel like you are having enough sleep when you are not. If you drink it constantly, you may be just tired but not know it.

Re: Ask HN: I lost my ability to focus for hours on coding. How to regain?

#57
post #14

This is a common problem. The book Deep Work goes into it in detail, and has some research-based techniques to fix it. Basically it boils down to removing distractions, and determination, gradually building up your brain's ability to focus again. https://www.amazon.com/dp/B00X47ZVXM

If I try eliminating distractions, I just end up daydreaming. I spend most days at work just reading the same shit over and over with nothing sticking. I manage to get work done in rare bursts after exhausting my brain with distractions. Fwiw, I'm in my mid 40s and have less than a year of treating my sleep apnea. I'm pretty sure I've had ADHD my whole life but blamed other things until recently. I'm trying to resist…

Holy shit, same boat, same age, on CPAP for about a year now, can't remember what was said in the meeting I was just in this morning. And browsing HN while I should be writing tests ;)

Re: Ask HN: I lost my ability to focus for hours on coding. How to regain?

#58
post #33

I wrote some things that help me focus here: https://wiki.nikitavoloboev.xyz/focusing Mostly it’s about practicing mindfulness throughout the day, setting goals, GTD approach of task management and using tools like Focus for automated Focus sessions throughout the day with breaks in which I am allowed to read news and relax.

Just logged in to say that the tips on your wiki are pretty good and overall all the info in there seems pretty valuable, bookmarked. Thank you for this!

Also, might give me some inspiration to make my own wiki ;)

Re: Ask HN: I lost my ability to focus for hours on coding. How to regain?

#59
I've had this happen before. For a six-month period I was able to finish my day's work and then head home and spend another 3-4 hours focusing on my own stuff. After having a three-week vacation, I lost this ability. I couldn't focus anymore. I was back to being a regular person.

Things I did to get my focus back:

One is that I introduced sugar/caffeine back into my diet. Drinking a sugary, caffeinated beverage improves my ability to concentrate significantly. While this might not be right for you, you might find that some of your other dietary choices are affecting the supply of glucose to your brain.

Another is routine. If you had the ability before, you can get it back again. One thing that helped me return to my groove was listening to the same music I used to listen to while concentrating. Having an album in the background on repeat can work wonders. Maybe there are some other important concentration triggers that you need to tap into.

Lastly, maybe your work just isn't that interesting. Rediscover what things you actually want to be working on. Get excited about something again.

Re: Ask HN: I lost my ability to focus for hours on coding. How to regain?

#60
post #14

This is a common problem. The book Deep Work goes into it in detail, and has some research-based techniques to fix it. Basically it boils down to removing distractions, and determination, gradually building up your brain's ability to focus again. https://www.amazon.com/dp/B00X47ZVXM

If I try eliminating distractions, I just end up daydreaming. I spend most days at work just reading the same shit over and over with nothing sticking. I manage to get work done in rare bursts after exhausting my brain with distractions. Fwiw, I'm in my mid 40s and have less than a year of treating my sleep apnea. I'm pretty sure I've had ADHD my whole life but blamed other things until recently. I'm trying to resist…

Or simply go to a doctor specializing in it and check with him what they think. If they suggest trying something - try it and see if it works. I was in the same boat. Can't really say it was a miracle, but it definitely helped a bit.
Post reply on HN