Live data from Hacker News

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

news.ycombinator.com

81–90 of 127 posts

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

#81
Caveat: I can only speak for myself and don't know if these are extrapolatable to others. I can't say I'm an über-focus person, probably mediocre, but I use tools to help be better. I know co-workers who would be in a deep focus while the house is burning around them, and I'm not at that level.

TL;DR: Reduce cognitive load.

Rule 1. Make your environment conductive to focus.

If you are in an open office, you have a shit sandwich to start with. So isolate yourself from the cognitive "filth and rabble". Long time ago I worked with a guy who built a cardboard wall and then wired a camo net over his cubicle, but maybe one doesn't have to go to such extremes.

Headphones: Use headphones and music to drown out co-workers talking and other noise. I don't play my absolute all-time favorite tracks on repeat, I play something I merely like: noisy stuff like some desert sludge metal or stoner rock -- I sort of tune out the music and the music drowns out all the noise. You'll need to experiment what music works best for you. I use Spotify and try to improve my playlists with new interesting music.

Tune your programming environment to have a look-and-feel that fades to the background. Nicer and duller colors. Learn all the shortcuts to be effective, and learn a powerful editor which gives you macros and regular expressions and whatnot. The less mouse you need the less mini context switch which is better.

Turn off audio notices, turn off all blinking "hey you have mail".

Rule 2. Coffee/tea in moderation.

Too much of too strong coffee within too short time makes my focus become scattered. My mind starts to get racy. The best thing is to dose coffee such that one doesn't go over the limit. A tea in the morning a few hours after waking up works quite well.

Rule 3. Notes and checklists.

It helps to be a compulsive note-taker. Before I start anything, I make sure to have a vague idea of what to do, then I make a checklist. I write down notes and think of next things to do while waiting for something. I do "self-retrospectives": when I'm done with a few hours work, I go through it and make notes and checklists of next things.

The checklist lives all the time, new things get added and old points get marked as red cross (not done, bad idea, didn't work, etc.) or green tick (done, clear, good idea, etc.). I use a program called Zim but you can do it with any editor.

Rule 4. Train your memory.

I've noticed it becomes easier to suppress problems from tiny context switches that way. One is less likely to forget the context prior to the interruption, and the notes help a lot with this, too.

Rule 5. Rest to recover.

When you're not at work, you're not at work and you should not be thinking about work either. Exercise, read, do something else you like.

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

#82
I wrote a blog about this a long time ago here: http://debugreality.blogspot.com/2010/03/hidden-dangers-of-w...

It basically boils down to understanding the negative effects of your work and taking responsibility for your mental well being by countering them which is where work life balance come from.

Previous HN discussion here: https://news.ycombinator.com/item?id=1203696

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

#83

Earlier quoted context omitted.

I'm actually really curious why you think I was being crude/taboo here. Maybe just a cultural difference? I spent most of my adult formative years in the military, and there's been some cultural friction ever since I ended my service. An explanation of your opinion would be quite welcome!

What? I was defending your comment, seeing the downvotes! Crude, well... to be honest, because of the slang words, eg. 'getting laid' and your argument could have been framed better to be more intellectually stimulating. Taboo, well.. because I don't see anyone else talk about this, yet it's such an important topic of human psychology / sociology.

I understood that you were defending it! The downvotes were a bit confusing to me also, as I felt pretty well founded in my original comment. As I said, I'm more just interested in your reasoning that I was being crude and taboo, because I have a background that seems less common among HN posters. It would help me better understand the downvotes!

I definitely could've swapped out "getting laid" with something more elegant sounding, such as "engaging in intercourse" or "stimulating a release of oxytocin", but I assumed that "getting laid" is both socially acceptable and has a well understood definition. Apparently HN disagrees!

I don't consider sex as a subject to be taboo, especially from a health standpoint. People get degrees from major universities that are entirely sex-related. So I guess I'm just a little confused by all responses, especially the one from hi41. Thanks for explaining your reasoning, it's good to hear the process behind these differences in opinion.

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

#84
I have a similar problem which is ruining my life. Not only I cannot focus on my work, I cannot focus on anything. I'm throwing my degree and my life down the toilet.

There's no light at the end of the tunnel right now. It's the worst feeling I've ever experienced. I know what I should do but I can't.

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

#86

Earlier quoted context omitted.

the worst advice ever. If you have medical issues - take care of medical issues in the best way possible. Challenging yourself = denying yourself treatment. Challenging yourself is not a treatment for something like sleep apnea.

Yes but the evidence for ADHD is dubious. We have a long way to go when it comes to understanding the human mind. Anyone, not just people with ADD, can increase their performance with narcotic stimulants. Just don't be disingenuous about it.

Just because ADHD is poorly understood and often diagnosed incorrectly does not make it any less debilitating to those who have it and certainly does not imply that they are not in need of medication. Yes the medication can be abused by those who don't need it to get an edge. This is what makes it a controlled substance. Opiates can be abused too and have the same effect on everybody. The difference is that people in server pain need opiates to function at a baseline normal level. People with ADHD need medication to function at a baseline normal level. The fact that some people abuse them to go beyond that is completely irrelevant

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

#87
post #84

I have a similar problem which is ruining my life. Not only I cannot focus on my work, I cannot focus on anything. I'm throwing my degree and my life down the toilet. There's no light at the end of the tunnel right now. It's the worst feeling I've ever experienced. I know what I should do but I can't.

what if you try to focus on something that you really want to do and not on something you have to do?. i.e. Plan to visit a new country and work from there a couple of weeks. Something that I did when I felt like that is check all the meetups around town and meet really interesting people that ended up being good friends and help me to see things with a different point of view

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

#88
post #84

I have a similar problem which is ruining my life. Not only I cannot focus on my work, I cannot focus on anything. I'm throwing my degree and my life down the toilet. There's no light at the end of the tunnel right now. It's the worst feeling I've ever experienced. I know what I should do but I can't.

Stress can make it difficult to focus, and being unable to focus can cause stress in our field. So, there's a positive feedback which is horrible to experience.

Having experienced this myself recently (a few months ago, for about a month acutely), the solution that worked for me is to cut the cycle at the "inability to focus causes stress" part. Just accept it - right now, you can't focus, and that's okay. The second part of my solution was to remove all distraction, and for periods of work I allowed myself to not focus on work, but I also agreed (with myself) to not allow myself to focus on other things, either. Eventually, a combination of stress reduction and simple boredom got me working productively again. :)

I've experienced this before, and last time I used medication (Adderol) to fix it. I think that's a valid way to break the cycle too, although I would recommend the above procedure first.

Note: This is a special application of the more general observation that most suffering comes from feeling bad about feeling bad, not the original feeling bad part. So, if you can stop feel bad about feeling bad, you don't have to worry about the first-order feeling - it will go away on it's own quickly, because feelings naturally decay pretty quickly. Also, if you want to talk to someone you can contact me via my profile.

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

#89
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…

Add a decade, subtract the apnea, but otherwise: Welcome to my world, or an exact replica thereof.

The thing is, I can focus on stuff I really want to do, but I can't fake the want. So - my personal pet projects are doing fine. As for work, my life has improved tremendously since I sort of gave up careerwise. These days I drive a bus and actually have some mental energy left over for my sparetime. No medication. I don't like the idea.

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

#90
Stop all use of these sites for a month.

See if other "distractions" take their place.

If no, then you're just addicted to social media and hopefully that month will cure you.

If yes, you're probably burnt out and need to move to your next exciting new job, or move house, or go on a road trip for a few weeks or whatever it is people to deal with burn out.

Post reply on HN