Live data from Hacker News

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

news.ycombinator.com

31–40 of 127 posts

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

#31
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. Dress for success. Socialize, integrate with the team, find the goals that will motivate you - be that helping out your work buddies, or building that sweet new piece of technology.

You want to have energy, health, mood, and motivation. When any of these suffer, your work suffers too.

Don't be afraid to use whatever tools you have at your disposal to cut out distractions and inhibit bad habits, but don't tyrannize yourself either. Working 8 hours straight isn't necessarily your most productive option. Consider scheduling breaks - but use your tools to limit your distractions outside of said breaks. Find a balance that will let you keep your mood up while also getting good work done.

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

#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.

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

#34
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 getting medicated, but I think I might it to get me focused enough to work on CBT and meditation.

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

#35
If you are not against some help from technology, then there are software/apps that block internet access for social media web-sites etc e.g. freedom.to

You could also try browser extensions, e.g. for Firefox: Mind the Time -- shows stats of internet usage; LeechBlock NG -- blocks sites.

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

#36
I would guess that your lack of concentration is due to boredom, maybe because you're working on stuff you don't care about. If circumstances requires you to work on uninteresting things, putting the distractors out of easy reach can help you grind away in the short term. In my own experience, I needed to change industries to work on things I found more interesting.

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

#37
post #30

Changing the color scheme in your editor can make your work seem novel again. Electronic music also helps me, but this is counterproductive for some.

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 :)

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

#38

I had that issue two months ago. I digged into my calendar and found out that's when I stopped going to the swimming pool, doing enough physical exercise. It's old knowledge but : "A Healthy mind needs a healthy body" stays true.

I tried exercise, and now that's all I want to do. Ugh...

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

#39
When you are coding, or when you are working? I'm asking because perhaps you just don't enjoy your job. Can you still code for some hours when you're working on side-projects or learning new things?

I have no useful tips to add beyond what's already been mentioned here. The only thing I can suggest is to clarify if your _job_ might be the real problem.

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

#40
I have a hard and fast rule to never use a work computer for anything except work. Also, enforce rationing your use of FB to after 7pm for 15 mins max. You'll find the hours spent wasted can be summarized in a 15 min block. The key for me is hard and unbreakable delimiters.
Post reply on HN