Live data from Hacker News

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

news.ycombinator.com

21–30 of 127 posts

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

#21
Talk to your supervisors about how you aren't excited about your tasks at work. If there's nothing they can do about it, quit. Find something that excites you.

A family friend of mine used to play violin in a traveling rock band. He slept in the van and loved every minute of it. Later, when he had a family, he settled down and became a contracted fundraiser for non-profits. One day he came across a particular non-profit that he loved, identified with, and felt excited by. He took a 50% pay cut and settled into a permanent position with that company because "it felt like being back in the van again"

If you're the kind of intrinsically-motivated person who can trick their head into being excited about 12 hours of being immersed in a problem, then you'd be an incredible asset to any company that gets you excited.

If you have an idea of what company, industry, or problem that might be (good news: people usually do), pursue it like hell.

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

#22

Watch more porn, or get laid more. I was having focus issues, because coding is fascinating but not inherently sexy to me. After working on a problem for a while, the enjoyment of the problem would become overshadowed by my sex drive, and I would start to find anything else more interesting. Ended up being my body's way of reminding me that I should make some babies before I died, so I was subconsciously distracting…

Realize that promiscuity is a disease vector.

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

#23
post #13
post #4

This may sound stupid or trite, but have you considered moving into a management position? Social media and Youtube may be stealing your attention because you simply enjoy them more. If coding was more enjoyable, you'd be doing more coding at the expense of those distractions. But maybe you just don't enjoy coding your current project. A lot of projects are not intellectually or morally stimulating, and it's hard to…

It might be surprising, but dealing with people still requires focus :) Also, instead of code, you write docs - so many docs. Which, again, needs focus.

I think the comment was more about the fact that social media is more enjoyable and therefore drawing OPs attention. If they moved into management, perhaps that would be more enjoyable and therefore remove the social media draw. They could have used any occupation not just management. Maybe OP just doesn't enjoy coding anymore.

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

#24
Momentum!

At least for me, productivity requires momentum and being at a standstill feels like quite a hurdle. So at least at first, work on something you're really excited about. Something that won't feel like work. It could be a small project you couldn't otherwise really justify spending time on, but do it anyway. Visualize the end result, get yourself excited, and finish it.

Once you've gained some speed you should be able to tackle other tasks and projects. Social media will start to seem less compelling than it does now.

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

#25
I had to completely clear my mind of the past, and of what others may think of my project/code. It's a brand new day, you're breathing, you can truly work on whatever you want.

When I'm hot on a new video game, I can't wait to fill the most immediate next hours on doing it. What was that for you at some point? I enjoyed QBasic in gradeschool and revisiting after years in the field was really fun.

Whatever that code is, I suggest pursuing it even if it's not

a) something everybody on here says we need to be doing

b) related to your dayjob

c) related to that "big project" that you need to do perfectly

I wish you the best.

P.S. strike perfectionism out of your mind

P.P.S: Practically look into using the Pomodoro Method

P.P.P.S: Either start or stop doing drugs. Or see a board-certified medical professional if you think that would be dope. It is.

edit: formatting as always

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

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

Thank you for sharing, this looks like a nice reference (although the irony of obtaining this link via hacker news is not lost on me.)

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

#28
For me, this means that a) I am not interested in my work, b) I am tired, or c) I am burnt out. All of these can be greatly helped by getting some good sleep, and a + c can be helped by having some fun - especially social or physical activity somewhere new (weekend trip, drinks with friends, etc).

You can try and force yourself to focus with tools and mental tricks, but that always seems to make me feel worse. Better to get at the root cause, which is almost always stress or physical exhaustion.

Post reply on HN