Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: How do you focus on work for long periods of time?
123 points by rd on Nov 11, 2022 | hide | past | favorite | 144 comments
I've used Adderall (not ADHD diagnosed) a couple of times, and it helps a significant amount. However, I know it can't be the real solution - my problem is concretely that anytime I work on something, I can't work on it for long amounts of time - every 15 minutes, I will either visit HN, Reddit, some game, or have to get up and physically leave the desk. I can't bring myself to work on things for extended periods of time. How do you guys do it?


Assuming you're a programmer working on software, the best way I've found to keep focus is to set up your development environment such that a) it's full screen on a big monitor without any other apps or notifications and b) the feedback loops are as tight and automated as they can be - as soon as you hit save, automatically run the tests associated with that portion of the code. This has the effect of "gamifying" the software development process - every change is filled with the anticipation of how the test will respond. I haven't measured such things but other commenters mention dopamine and I suspect that a tighter development feedback loops produce more of it, allowing you to keep focus.

More generally, I've found that blocking off calendar time for "deep work" is effective if you commit to a plan for each time block. Before starting, I define what I'm trying to do and what the outcome would look like if successful. The first step is always to write a test that measures success in that context - it does not have to be a unit test or even something that you commit, can just be a simple curl command or bash script or a "I hit refresh in my browser and I see the image". Then I iterate until the test passes or time is up (generally because there are bigger issues)

And finally don't be afraid to engage in social media or games or other distractions - but do it in a mindful way. I use time in between deep work sessions to chat with friends, browse HN, write long rambling comments on HN, etc. You have to allow yourself idle time but keep it well and truly separated from deep work.


Practice long periods of not having stimulating activities around you. Just sit and be bored for a few hours at the end of the day.

This will increase your baseline dopamine for normal activities. When your baseline is too low, you self medicate by going on Reddit which spikes your dopamine for a while. Taking a break from stimulation lets your brain accumulate dopamine naturally


100%. Another tool available is to generally move to lower-intensity dopamine producers. Long/slow/thoughtful videos over short/fast/bitesized videos, books over videos, old/clunky/slow games over new/polished/fast games, board games over computer games, and so on.


I think I'm, in a way, OP-who-took-this-advice. I could have written his post, and I'm mid-journey on your advice.

I sort-of naturally fell into it. I'm just not as interested in HN or Reddit anymore. The whole internet feels like it's arguing, not discussing, and that rubs me wrong. So I feel very bored by the internet right now, which is something I never thought I'd say.

It's allowed me to really focus up on some other things like my fitness and some real-world projects, but I wouldn't say the struggle is over. The dopamine cycle is legit.


One of the many aspects of meditation is "sit and be bored". Of course the mind has a tendency to fill in the boredom with thoughts, ideas, worries, etc. Learning to notice those and return the attention to sitting is surprisingly difficult, and may take years of practice.


As a full blown ADHD person. Boredom is physically painful. worse then most other pains I’ve experienced. Basically a terror of being bored.

First time I took medication it blew my mind that the pain of working on something boring was gone.

I rarely take the medication due to side effects. But I can function somewhat better now that I know what it’s like to basically be normal.

I still get way more done on medication.


That's fascinating and probably good advice, although it does raise the question of whether the cure is worse than the disease :-)



wow. awesome tip. thank you


There’s a lot more tricks to lowering your dopamine baseline:

https://hubermanlab.com/controlling-your-dopamine-for-motiva...


Dr. Huberman is great, his videos can run for long (over an hour) but he breaks down everything and explain things in detail. I've enjoyed watching his video on ADHD.


Here’s a few things that I have found really helpful recently:

1. Put your phone in another room and only check it at scheduled periods. For me, after breakfast I put my phone out of sight until lunch and then back in the other room it goes until 3:30 PM.

2. Try to keep separate spaces for entertainment and focus. For example at your desk only do productive work like development or paying bills. If you want to watch a youtube video then take your laptop to your couch and watch it there or just watch youtube only on your TV.

3. Check out this podcast from Andrew Huberman called Focus Toolkit on focus cycles, focus music and more.

Also don’t be afraid to take breaks (without a screen), we aren’t machines. Just walk around and daydream sometimes


Focus Toolkit episode: https://youtu.be/yb5zpo5WDG4


The whole series is excellent. The actionable items are clear and well defined and I started following some of them last year. The benefits cannot be put into words.


It's also good to make habits, they work the same way. I recommend checking out Atomic Habits, or at least this YouTube video [0].

[0]: https://www.youtube.com/watch?v=PZ7lDrwYdZc


This is why I fucking detest two factor authentication. I have to 2fa probably 30 times a day for work and it just constantly puts my phone in my hands and I end up habitually wasting time


Maybe you should try getting a dumb phone for your 2FA? My nokia 3310 is a delight to carry and forget about.


Can't, My 2FA requires both an authenticator app and an RSA token app.


Wake up at 5:00AM.

5:15AM. Get in that ice bath. Fourty minutes or it's not worth it.

6:00AM. Write a C compiler. No help from internet.

7:15AM. Breakfast. Soylent and fifty pull-ups.

8:00AM. Enter the zone. Crush your work.

8:00PM. Exit the zone.

Just kidding, idk you kinda just have to like the problem at hand, otherwise it's too easy to go distract yourself. Distraction isn't really an evil thing though, it's not like we just enter The Zone for eight continuous hours. Engineering problems aren't usually mulled over like that, at least for me.

Oh and don't do drugs to make yourself better, that is a silly trap to fall into. Drugs are fun, do drugs! Using them as a crutch, or thinking they will alter the course of your life, that's the lie.


This reminds me of "The Hustle" video by KRAZAM, who parodies various stereotypes and whatnot: https://youtu.be/_o7qjN3KF8U


I also pour bulletproof coffee on my balls several times a day, then snort some crushed adderall. Helps a lot...really feel like I'm closing in on 11x.


Making time for fun (including drugs) can definitely alter the course of your life (for better or worse).

Microdosing for productivity is a waste of acid. Macrodosing on the other hand...


You're wasting your time if you aren't writing the C compiler from the ice bath. Seriously, kids these days.


This is my method. I am blessed with being able to concentrate ferociously... had to train it a bit but most of it is innate ability. This works for me personally. I don't want to come off sounding like "hurrr just start working"..! And to OP: maybe get tested for adhd?

---

You think of all tasks you can do at the moment, things where you are not blocked by anything. You prioritize them, say on urgency or on what you personally feel like working on if your work permits freedom. This takes 60 seconds at most because of course you are anal about keeping a sane, up to date diary/to do list/kanban board.

You start working. You don't check your email, slack, messages, whatever. Let them call you on your phone if the world burns - but even that you let go to voicemail on the first call. You just start working without delay. And you keep going. After the first 5-10 minutes of forcing yourself to settle into your chair and ignore your painful wrists, you enter a state of flow.

It'll be like driving eventually. Remind yourself to take a break every two hours, drink something and maybe eat a little. Dehydration is a bitch. But even as you take a break, your mind won't let go completely. You keep this up for 4-8 hours a day, answer some messages and turn off your computer... hopefully.

Be sure to really unwind at the end of the day. Doing this 4-5 days in a row without unwinding will mess up your weekend big time as you just can't go back to baseline


You might be trolling but I relate to your comment 100%


Tongue in cheek maybe, but not trolling.


I code under Linux where I have no games installed. Also no music running. And then just have at it. When I see that it's not going well, I quit and boot Windows, play games and do all the stuff that scratches that itch until I'm bored with it. Next day I try again and see how it's going. Repeat until it works. But then really use that time when it works. This usually turns into 12+ hours work days that are enjoyable.

This is however not how it works when someone employs you. That's also why I shy away from getting a job. It's not compatible. Or maybe I'm out of the loop and the industry has adapted to worker's needs?

The way I work is, I have work phases and leisure phases. The work phase usually lasts 3 weeks, followed by a leisure phase 1-2 weeks long.

In the work phase, besides getting food, I only work. 12+ hours a day, usually 14, until my eyes bleed and I have to go to bed. Getting food includes a walk for 1 hour. When I'm stuck at a problem I also go for a walk or shopping. Then randomly I just can't do it anymore and have to stop working. The leisure phase begins. This is the time where I refill my tolerance for this game I play, called work. I don't work at all until I'm bored of not working. And then, see the beginning of my post.

Also when I work, I'm on a mission. My mission is to finish this product and nothing can stop me. It's my holy mission. I have to complete it. I'm interested in it. I want it to be finished. It will be finished. Don't distract me! I'm a fucking zealot. Get out the way.


> That's also why I shy away from getting a job.

What's your source of income then? I guess being a freelancer with somewhat flexible clients would work, is that the case?


Yes, I run my own sites monetized mainly with ads.


I would try to understand why you can't sit for the task for long. Maybe it's too boring, or too hard. Maybe it's unclear what the task even is.

A somewhat spiritual take on the whole issue is Steven Pressfield's "The War of Art". One of my favourite books, and I'm as non-woo-woo as you can be.


> my problem is concretely that anytime I work on something, I can't work on it for long amounts of time

If this is always true, even when you're working on something that interests you, maybe consider getting that ADHD diagnosis? If it's just something you struggle with occasionally or when you're slogging through boring tasks that's something you should be able to improve.

It really depends on the type of work you're doing though. I doubt there'll be any one trick that works for everybody in every situation. Sometimes having music or a podcast or a TV show in the background keeps my mind engaged while I'm working on something that isn't exciting enough to keep it quiet. Sometimes I just need lots of breaks to keep my sanity. For work that requires a ton of focus I tend to work best in quiet dark places where there isn't much to pull my attention off of what I'm doing. Caffeine never hurts no matter what I'm working on.


An indication that it might be ADHD is if you struggle to focus on the things you genuinely want to be focusing on. Not like “I should be studying” but like “I want to play this new game I bought.”


Really? I don't think ADHD is a thing in Europe; I know plenty of people (including) myself that would struggle to focus on things their genuinely want to be focusing on. I myself bought a videogame last week... and I haven't yet played it. I don't think I have ADHD, I mean, I think this kind of stuff is normal to some extent. If I have to "wash the dishes" I will. I have to work, I'll work. Sometimes, though, I won't wash the dishes because I just don't feel like it. Sometimes I'll procrastinate at work, but I'll catch up eventually. I think it's just life, some times you struggle with stuff, but that's alright.


> Really? I don't think ADHD is a thing in Europe;

ADHD is a thing in humans, not countries or cultures.

It’s honestly still very early days in terms of research and understanding, as for the longest time they thought people grew out of it. You don’t grow out of it, you just get taught by society how to hide it—unless you’re lucky enough to put the piece’s together and get diagnosed.

> I know plenty of people (including) myself that would struggle to focus on things their genuinely want to be focusing on.

ADHD isn’t really an issue with focus. We can spend a day wanting to focus on something, but not. And we can spend a day fully focussing on one thing and forgetting to eat. It’s an executive function disorder. Deploying focus is hard. Switching focus is hard.

Everyone struggles with focus from time to time, especially when the world or life gets stressful.

We’re currently in (hopefully) the tail end of a global pandemic, watching what may be later referred to as WWIII, going through the second major economic downturn in as many decades, and watching some western countries’ democracies under threat.

I know there’s always a lot on in the world, but recent times do seem more stressful than the years before. So it’s reasonable for everyone to have issues with focus, and yep I agree with you that’s not reason enough to suspect ADHD.

> Sometimes, though, I won't wash the dishes because I just don't feel like it.

I just want to point out, as someone with ADHD when I don’t wash the dishes it’s almost never because I don’t feel like it.

Rather, I might be doing one task when I notice the dishes need to be done but doing them at that moment would involve an expensive and painful task switch.

Then when I’ve finished the task, I have a good chance of forgetting the dishes, and might only catch them again in the middle of another task.

I always watch something (often a tech talk from a conference on YouTube), because even with meds dishes a woefully under stimulating.

I wanted to add this context because those with ADHD are often blamed as being lazy, but that not the case. It’s more like you and your mate are going for a run, and you’ve got an invisible 100lb rucksack on and you just can’t keep up. Meds is like someone removing most of the weight from that rucksack.


> I don't think ADHD is a thing in Europe

Mental illness doesn't respect borders. Of course it's "a thing".

See for example: https://adhdeurope.eu https://www.eunetworkadultadhd.com

It sounds like you don't have ADHD, so you experience normal things like procrastination. That's fine, but ADHD is something else entirely. It's a neurodevelopmental disorder that results in executive dysfunction. A lot of ADHD symptoms are things people without ADHD do encounter occasionally, just less often and to a lesser extent.


So far, the solution that has worked for me has been Focusmate (https://www.focusmate.com/).

It's like Omegle for focus. Pick a time slot and pair up with someone to be accountable together.

You can get more information on how it works here https://www.bbc.com/news/technology-46624137

You can also book a session with me if you like. https://www.focusmate.com/i/nLUDAIR5oh/calendar


I've been curious about these kinds of services for a while.

Genuine question: do you not end up just chatting with your paired partner?


It's very bad form (and against the rules) to make chat the focus. You will eventually get reported if you do it a lot. A short chat at the end is fine.

The session template is: brief greeting > outline what you're gonna do > wish the other person well > mute mics and get stuff done for the bulk of the session > end of session chime sounds > share how well you did (and here you can chat for 2-4 mins if both parties are keen)


So far it has not happened to me. You only speak before starting and at the end. During the session we both mute our microphones.


Know yourself very well.

I shorten my deadlines.

I delay everything, always and I know that working under pressure I'm the best of me (yes, maybe is shortening my life expectations..). At the other side I know that working with me is giving maybe 120% of you, so I set my deadlines earlier for me.

Then I do the shit because that deadline I set is my deadline and I'm very proud guy that wants to do the shit on time.

Then when the thing is done I have maybe 2 to 3 days to review and relax.

But the best recommendation is: to know yourself.

Sometimes your mind (and body) needs to run away some minutes.

I'm a former teacher also and I know that you can't focus too long on something that you don't want and doing that is bad for you and bad for the stuff you are doing.

You needs something that makes you want to focus, for me is the pressure of deadlines.

I need to talk with my psychologist..


I put on my headphones and blast music by Two Steps From Hell (Thomas Bergersen, Nick Phoenix).

Edit: A lot of people saying you might have ADHD. I wouldn't jump to that conclusion or worry about that. Don't spend time chasing down a diagnosis unless you really, really need the medical assistance. It's probably our modern attention economy: the Web has trained our brains to seek diversion after a few minutes. Call it ADHD if you will, but then pretty much everyone who spends time online has it. It's healthy and "normal" to take a breather / quick break every so often. It lets the mind decompress. The trick is training yourself to do it only when that break won't interrupt a deep stack in your brain that you have to spend a lot of time rebuilding later.


> Call it ADHD if you will, but then pretty much everyone who spends time online has it.

While everyone may experience times that are similar to what is described as ADHD, it only affects about 5% of the general population (and about 8-10% in our industry based on the stackoverflow developer survey).

OP if the meds helped and you find long concentration hard, it could be worth investigating. Worst case you confirm it’s not.

If it is, this isn’t the only place it will affect. And it won’t be recent you’ll have been dealing with this since before you were 12.

Despite its name ADHD isn’t an issue with attention, it’s an executive function disorder. The bigger challenges are with starting, stopping and switching tasks.

Someone with ADHD can be perfectly capable of completing a task, but their brain will not let them do it. No matter their strength of will.

This is a double edged sword with hyperfocus, where you get into a task that you go deep on, and it’s damn near impossible to pull you out of (in some cases, you might not even want to be doing it anymore).

> It's healthy and "normal" to take a breather / quick break every so often.

Yep, Pomodoro is based on this. Depending on the task everyone needs a break.


I use the Pomodoro Technique. Given that it divides the day into 15 minute work blocks, it might work well for you too.

https://en.wikipedia.org/wiki/Pomodoro_Technique

It's worth reading through the original Pomodoro Technique PDF, since planning and tracking is an important part of the process:

http://friend.ucsd.edu/reasonableexpectations/downloads/Ciri...


I have one colleague who does pomodoro religiously. Pairing with him is always so relaxing because you don’t forget the break.


Focus, like many skills, can be improved, but takes practice and training to build up longer focus times. The below is mostly based on ideas from the Pomodoro Technique®[1]

To start, do a task without distractions for your current ability - 15 minutes. Set a timer and stay on task until time runs out.

Take a short break - 5 minutes, maybe 10 at most.

Repeat the above 2-3 times, then take a longer break, something around 25-30 minutes. If you feel OK, do another 2-3 rounds and then go do something less taxing that doesn't take deep focus.

If you have truly focused for the time, you'll know it. Just starting out, a couple of hours of work will definitely sap your energy.

Gradually increase you focus works times by 5 minutes. If you can get to 25 minutes without feeling the need to do something else, that's great. If you can do the above cycles with your full attention for a total of four hours, you're doing well. Not a lot of people can do really intense, focused work for more than four hours a day. The rest of your work day, do low-intensity things like answering emails, cleaning up your work area (both physical and virtual), and such.

There's an entire book devoted to this that I can recommend: Deep Work Rules for Focused Success in a Distracted World, by Cal Newport.

1 https://francescocirillo.com/pages/pomodoro-technique


I found that I am good at long periods of focus but tend to have a hard time getting into them without falling into distraction.

My current solution is to:

- minimize distractions (I mute websites and use an extension to block youtube/reddit/facebook), - have a background music that drown out noises (there are online generators[0] but I found a particular song plus rain noise combination [1] to be a great fit for my brain)

[0]: https://mynoise.net/ [1]: https://youtu.be/9kgRHg3TaAI


When I used amphetamine salts I had a few rules for myself: Don't overdose, keep to low, clincally useful doses. Don't drink coffee and take amphetamine at the same time - too much stimulation, plus I don't eat breakfast. Try to eat and sleep, it's very important for your brain functioning. Stay disciplined, if you find yourself distracted try to calm down. A lower dose often helps me focus. I couldn't do work on more than 10mg of speed.

Amphetamines worked well for a while but they started having all kinds of messed up side effects so I quit them and I'm glad I did.


> Amphetamines worked well for a while but they started having all kinds of messed up side effects so I quit them and I'm glad I did.

So, why on earth would you recommend them (or even bring the topic) here? I don't get it.


I don't recommend them, this person is already on them (Adderall) If you are taking them, try to be responsible.


Modafinil seems like a lighter alternative to amphetamines for people who don’t have ADHD.

I tried a small dose of Ritalin and ended practicing handstands for half the day.


Someone who isn't me occasionally found it funny to add a microdose of amphetamine to an energy drink at lunch. But, yeah, long-term side effects can easily overweight any additional focus. Plus I'd say that what you gain in focus you can easily lose in creativity (possibly more a side effect of sleep deprivation than substances). On the other hand, microdosing psychodelics can sometimes generate a lot of creative energy (some of it even remains long-term) at the price of being slightly distracted for a while on the days when you dose. Also, getting stoned after work but way before going to sleep can work well for getting enough rest and getting your mind of the need to be focused. In general, I'd recommend the last part plus good dinner to everyone and also be more chill, work is not the whole of your life, go kiss girls or something.


The side effects came from sparing use? Like perhaps once a week at most, but once every 2-3 weeks ideally.

I've actually found that a very small 2.5mg is MORE effective for doing work than 5-10.

I do it once every 3-4 weeks not only to get stuff done, but refresh/reset how to "be in hyperefficient flow" where you just get stuff done and enjoy it.


Yes exactly. I was bad and abused them taking 10-20mg or more and that led to bad things, I struggled to control my usage. It's best to do it the way you are.

The first side effects are mental, you also get physical side effects like body aches. I'd rather never experience that level of anxiety ever again.


At what rate of use did it become a problem?

I'm basically asking, do you think once every 2-3 weeks will be an issue? I think something about relying on it, even at 2-3 weeks, might make it an issue long term. But I'm not sure.

It doesn't affect me the same way as it did 10 years ago when i first tried. Back then it was euphoria and now it's just slight concentration. Which is ideal for working. But the euphoria is mostly gone.


Yes the euphoria is the first thing to go, got to wait quite a while for that "magic" to come back.

I was using it daily for about a year or two, and it really helped but also caused issues with my personal life, relationship and so on.

I think you're probably ok, keep in mind it is a neurotoxic drug so you'll want to mitigate that, and your usage as much as possible, antioxidants, not overheating and that sort of thing.


Taking drugs is really bad advice.


What are the messed up side effects?


Extreme fatigue, depression, stomach pains, getting very annoyed, stressed and anxious, smoking and drinking a lot more. There were more but I'll stop there.


Get tested for ADHD, even if you believe you might not have it.

I'm in my mid-30s and been somewhat successful at work but my pattern has always been that I could hyperfocus on some projects for days on end and suddenly I would be bored out of my mind and not able to focus for more than 20 minutes at a time.

I've blamed and shamed myself for years, thinking I was being lazy, that my work ethic sometimes was poor/lacking, that I could just force myself into not being in that state.

Now in my mid-30s after some years of therapy my therapist and I are uncovering that I very likely have ADHD. I don't want to be medicated, I know some terrible stories from close friends who have been medicated for more than a decade and even though it helped them somewhat the side-effects were no joke after so long. Even without medicine it's really helpful to understand why I behave like this, why I can't seem to muster the willpower that my peers and friends sometimes can to be focused for hours (with breaks).

I'm only learning now, after 30+ years of life why I'm like this, I don't wish on anyone to live this long shaming and blaming yourself for supposed failures because you don't fit the mold...

Even if you don't have ADHD try some therapy, you might uncover other reasons on why you might not be able to focus for long, there might be issues with perfectionism, fears, etc. that you are not completely aware of.

Hope you find some peace, I'm slowly getting it and it's awesome to lift this burden, even if slowly.


> Now in my mid-30s after some years of therapy my therapist and I are uncovering that I very likely have ADHD.

That’s about the time I found out too.

> I don't want to be medicated, I know some terrible stories from close friends who have been medicated for more than a decade and even though it helped them somewhat the side-effects were no joke after so long.

So, not saying you need to go and try medication—if you’ve found a way to live a happy and healthy life keep at it.

But, it’s good to know that some ADHD meds aren’t right for some people. There’s about 5/6 different options whose effects and mechanism of action vary. Most of the frontline meds are stimulants, but a couple are not.

What works well for someone, could be horrible for someone else. Finding the right one can be really easy, or difficult and take months.

A decade ago I suspected I may have it, but severely misunderstood what it actually was and ignored it. If someone had of told me then what I know now I would have jumped on it. Meds changed my life for the better, and I wish I had the opportunity a decade ago.

Until you’ve had chance to try them, I’d caution writing them off.

For everyone else reading this, meds help. But they’re not a cure. They’re often likened to glasses. Imagine having permanently blurred vision. There’s a lot you could still do, but damn if it isn’t easier with a pair of glasses.


It seems that the problem is shaming oneself. What utility does shaming oneself gives to those who don't have ADHD?


What were the side effects that were no joke after so long? I started taking Wellbutrin recently.


Yet these days they've taken to not treating ADHD anymore. The psych(o) people will pile on to that guilt trip and make you feel like the worst person, while telling you that you should just quit your job and end your career.

People need to understand that if you have ADHD your psych, doctor, and therapist are your worst enemies. They basically operate as secret agents for the insurance companies in order to gather information to permanently remove your health care (not just mental health care, but it crosses over into traditional medicine).

Psychs and doctors are responsible for carrying out the genocidal orders of powerful elite. Just like Police officers they are shady low-lifes, with fragile egos; the fruit of their labor is almost entirely death and destruction... tread carefully.

I'm really sick of these warnings getting shot down and censored. Since covid, doctors/nurses have been untouchable with at least 40-70% of the public. This is something that effects millions (100,000s?) of Americans, but talking about it gets you branded as a dangerous crazy person... but I get how it sounds.


> They basically operate as secret agents for the insurance companies in order to gather information to permanently remove your health care (not just mental health care, but it crosses over into traditional medicine).

I live in a country where I don't have to care about that so none of your conspiracy really applies to me :)


Hmm, that's interesting and... good for you? I'm not mad, it just seems weird to brag about this kind of thing to people that are being (lightly) genocided, or otherwise smothered to death by this oppressive system.

Also, I'm interested in where you live. As far as I know, these are issues in many countries. I don't think I've heard of a developed country where people don't have do deal with some form of care rationing, or being diverted away from treatment, due to some overcautious concern.

It may not be the insurance company, but it's definitely happening in CA/UK/AU.


For now.

Give it some time.


Some ideas for you.

Ctrl-f "fite timer"

https://www.friendlyskies.net/maybe/the-balance-first-approa...

Start with 45m break, 5m clarity through planning, 10m direct work tasks.

Ctrl-f "debrief" after that and use the debriefing module.

If you are still struggling then look at the words you are using to describe the problem you are experiencing, they are probably not accurate or they leak too much leverage in your case.

Try to keep all square/T list items to less than 2m each and in batches not to exceed 10m per long timer cycle.

More troubleshooting:

https://www.friendlyskies.net/maybe/defeating-procrastinatio...

https://www.friendlyskies.net/maybe/what-do-you-do-when-you-...

Foundational:

https://www.friendlyskies.net/maybe/the-productivity-triangl...

Good luck & hang in there, you got this.


Programming is a type work that invites distraction. A lot of Googling, so much advice exist on Reddit/HN which are filled with distractions, countless rabbit holes in every language and libraries, fractions of free time during compilation, etc.

I can easily read, play sports, or practice instrument for a full hours without a single moment of interruption, but it's much more difficult for programming.

To mitigate that, I've employed the following tactics:

1. A browser plugin called Intention, which gently reminds me when I visit one of the sites. I love that it is a gentle reminder, because sometimes the answer I seek is on HN/Reddit. It just makes sure that I'm browsing with deliberation.

2. I have a list of stuff (relevant to the current project) to do always ready by my side. When compilation takes place, rather than context-switching to an entirely different activity, I deal with those small tasks that are still in the same project. If there's nothing else to do, I start writing notes about my current work. I find that keeping such a logbook very helpful, both in maintaining concentration, and in organizing my thoughts. Regardless of what project I'm working on, there's almost always something to work on or think about, anyway.

3. I have dedicated news-reading time where I browse my RSS feeds and HN, and stuff. It reassures my lizard brain that I'm not "missing anything". (And I'm genuinely interested in reading news, and HN). Avoid drama.

4. Physical exercise intermittently. I do a five-minute HIIT every half an hour or so. The adrenaline keeps me mentally refreshed.

5. Ultimately, it's better if you are into the thing you are working on. If you are just not interested at all, it's very difficult to force yourself to concentrate.


For HN, goto your profile and turn on “noprocrast”. HN will then limit the time you spend here and not let you back in for awhile.


I didn't know that!


I hired an intern. Pair programmed with him for a couple months straight out of a code bootcamp. Nothing will keep you in the zone like pair programming, especially on boring tasks.


Maybe that's why there are so many pair programming zealots? You can't focus unless you bring someone?

It totally doesn't work for me, I can retain max 5m out of every meeting including pair programming.

Most pair programming end up being someone doing the work while the other browse Twitter and pretend to follow.


Then they’re pairing wrong, imo. I’m a believer in pair programming because of the focus and communication it encourages but it still requires effort and practice.


I found using an inhaler helped me to breath during periods of chest tightness and more easily during exercise do you think I'm asthmatic?

Go get tested for ADHD, man.


What's the point? They just refuse to help now.


A cup of tea on the balcony to get my thoughts together when I start a day.

One or two hours of work then a break, then a little more work then lunch. I set alarms. It's easier to pick up interrupted work than starting something new after a break.

My apartment is quiet. My computing environment is quiet. There are few things to pull me away from work. I agree with perrygeo that feedback loops should be fast to avoid getting distracted.

I sign off in the middle of the afternoon when my productivity wanes.

I'll sometimes use SelfControl to block websites when I really need to stay focused, but can't find the motivation.


If I care about some aspect of the thing to be done - even if it's just for my own ego - then sometimes I'll give myself less time to do it in, such that if I don't focus and it doesn't get done (or done well) then something I don't want to happen, will happen (be harshly criticized, lose money, let myself down).

Provided I value the thing, my body/mind will come around when demanded of, often slowly.

If I don't care that much, or the downsides don't feel so bad, then I try to practice giving up that thing (in whatever way I can) or just not doing it well.


Music may help as several others have mentioned - personally I find classical piano or organ music works well; but I also use a white noise generator instead sometimes, so that might be worth trying too. Somehow it's good at drowning out the little distraction "what's on HN now" itch. I use "A soft murmer" on Android, but I expect they're all much of a muchness.


+1 for music. I have observed that every day that feel unproductive (self-interruptions, getting up for nothing, start-and-stop on work tasks), it's because I forgot to start a good playlist in the morning.

In contrast, if I have the music blasting (rap, techno, rock, anything really) then I can accumulate hours of consecutive work, and get into the flow state.


I've spent most of my career coding in offices drinking coffee. I have taken many breaks from caffeine for weeks to months at a time. Many aspects of my life improves like sleep, stress, irritability, awareness of surroundings/smelling the roses. One downside is that I seem unable to focus. Eventually I'll start introducing tea, stronger tea, coffee, until I'm back where I started. [I also enjoy coffee, even decaf, but that's a slippery slope.] And the cycle repeats. Having recognized this, I'll sometimes time the phase of this cycle for when I can benefit most from it. Sometimes background music can work, but it's very tricky to find the right music and it's not always the same type that works. Another solution might be if I got lots of regular exercise but I don't have the patience for it--all the while wasting free time tired from an end-of-day caffeine crash.

My case seems much less than yours and I haven't found a steady-state solution either. Coffee might not be your thing. Don't know if there's anything to take away from it but that's all I have.


Yup, I used caffeine and alcohol for years to deal with ADHD symptoms and only got diagnosed recently. Now, I can't even have them, for medical reasons.

Anyway, maybe you have ADHD lol, and caffeine is not a particularly good substance for the condition (not the worst, but it has a bad stress-to-focus ratio, IME, and Drs seemed to confirm this)... maybe it's better than long term nicotine (although in the short term nicotine can be very helpful).

Basically, I'm experiencing the same as you. Without the chems I'm fucked. Btw, stimulant medication won't necessarily disrupt your sleep; it's also not a silver bullet.


If you can already focus on a task for 15 minutes, try using the Pomodoro technique.

Set a kitchen timer for 25-30 minutes (just 10-20 minutes longer than current!) and focus singularly on your task. You can check Reddit, HN, etc after.

If you can get into flow, keep going. Otherwise, keep increasing your timer by 5-10 minutes until you've trained yourself to work for 60 minutes straight. Remember to take breaks though!


What works for me

* to keep my phone in another room than my work room * to put some background Lo-fi music (Check playlists on Spotify: https://open.spotify.com/playlist/2rN3mSrzUcgjlj1TcEDTX7?si=..., https://open.spotify.com/playlist/37i9dQZF1DWZZbwlv3Vmtr?si=...). * to start a timer (let's say 50 mins), work focused * to disable "tap to wake up screen" option in phone for notifications or even general to unlock


Beyond all the other advices (don't overeat, don't over drink, sleep well, check your blood/urine tests regularly, etc.), time-block every event of your life in 15 minutes-increments (use whatever fancy or banal calendar app for this, time-blocking should become as natural as breathing) and optimize with time for larger and larger blocks. In 5 or so years you will be able to predict the events of your next few days with 70+% accuracy (even more if living a stress-low life) and plan for large swathes of time. Planning for 14-hours straight focused activity becomes then a simple entry in your calendar. As in everything, meden agan, nothing in excess [1].

[1] https://en.wikipedia.org/wiki/Delphic_maxims#Entrance_maxims


One of the neat ways to stay focused is through a technique called body doubling! ( https://doubleapp.xyz/blog/how-to-body-double ) Having another person around really creates a unique encouragement to keep on your own task at hand.

Also a critical part is not necessarily focusing for long periods of time, but to make the focused time more mindful with breaks in between. For instance, Itzhak Perlman (arguably one of the best violinists of all time) frequently emphasized that pros should practice between 3 and 5 hours a day just due to the fact that after that point the body can't absorb any more. He also emphasizes breaks too; instead of one full hour, do 50 minutes on / 10 minutes off.


I don't anymore, because it hurts my eyes. Hour maybe, go for a walk, do another hour...

Hopefully my eyes clear up once I get a break.

Treat your body well, don't waste it making someone else rich. Besides, most of the time spent solving engineering problems is spent thinking. You don't need to do that at the keyboard.


I have to do authentication on my phone for my work VPN and other logins, plus I go for walks and still want to be able to answer slack so I keep my phone around. This obviously leads to distraction with various social apps, so I recently installed an app called Opal which does the app blocking, but doesn't let you get around it unless you sit and wait for 30 seconds before taking a "break".

The app is a bit pricey, $100 USD / year, but I sent a message to their customer support and they offered me a year subscription for $30 / year, which ultimately is worth the focus I end up getting for 9 hours a day, 5 days a week.

Having good habits also help, but that takes diligent practice and discipline, which for me ebbs and flows.


First you need to realize that most of the work that comprises of a Software Dev work is mentally taxing work. You getting distracted could also be a way for you to cool your mind.

Apart from this however I believe you can benefit by training your focus. You can do this by a variety of ways:

- Pomodoro Technique but start off with 15 min work & then X amount of break. Then slowly increase the focus time every week by 5 minutes perhaps?

- Dopamine Detox: This only works if this is the reason for your distractiveness

- Figure out if there really is something underlying that's leading to anxiety? Are you afraid of the outcome of your code? Do you fear the task you are working on?


A tangential question. What exactly does it feel to be like in Adderall? I'm intimately familiar with the 15-minutes venture into Reddit/HN etc so if I were to, say, take Adderall, just what exactly inside me would change?


Look at some code, hold your attention on it, think about the methods and types and interactions with other objects. Hold all of this in your working memory to the exclusion of anything else. See how long you can hold it for.

Now start loading more into your working memory, after you get N classes deep things will start to get fuzzier, you won’t be able to hold it all in your mind at once, you’ll get unfocused, and then go to hacker news.

Imagine if that fuzziness didn’t start, but you kept that sharpness of working memory easily. Imagine it was effortless to keep reading, and imagine other thoughts (biological needs or whatever) never distract your working memory.

That’s what it’s like for me, unfortunately I get terrible headaches after, and the amount of time it takes to recover causes a loss in productivity that is greater than the productivity I would have got working at a comfortable pace.

Much better is diet and exercise, with diet and exercise I have vastly increased my ability to focus and remember, much better than any artificial chemical enhancement.

There are no shortcuts


Those headaches can be hydration-related. A "life hack" (I guess addy/adhd hack) borrowed from the keto groups was to find a way to intake potassium a few hours in to it, in combination with your likely more than usual water intake. The suggestion I once found was low sodium V8s since they’re high in potassium to offset the sodium but keep a level of taste. Life changing to say the least for those days I would take adderall.


I was diagnosed with ADHD and was prescribed vyvanse. The first day I took it it was an extremely intense calm feeling. I had a design doc I had been mulling over for weeks but for some ungodly reason was unable to actually put onto paper. When the drug kicked in I was fully alert and all the uncomfortable feelings that had prevented me from actually doing what I needed to do went away. The doc was written in 3 hours.

I will say, it definitely brings you above baseline in ability to concentrate, even with adhd. I was basically unable to do any deep work because of random 30 minute meetings interspersed throughout the day. With vyvanse I can basically leave a meeting and within 5 minutes of it finishing be in the zone working on a different task.

I'm on week 3 now and the intense calmness has faded but my ability to do tasks and focus remains to a certain extent.


No ADHD diagnosis here, but to me amphetamine feels essentially the same as the feeling I get on a very productive day, only stronger and constant.


https://www.di.fm/progressivepsy <= Any 24hr stream of non-vocal electronic music should do the trick, but progressive psy is basically a brain hack as far as I can tell.

I find certain kinds of electronic music entertain my lizard-brain sufficiently that I can think clearly and never get those distracting thoughts, "i wonder how my comment's doing on HN", "Have I checked the news recently"... etc.

I owe my PhD to di.fm, I use premium so I don't get ads and I'm very happy with the result.


If you can only focus for 15m at a time, then work on increasing that naturally.

Make yourself a timer app that will increase your work time by N every day before sounding an alarm, then browse/do whatever. When you come back you restart it and do another block.

As other people said, it's the possibility of interruptions that break your concentration. I'm working in game dev (Unity specifically), and it's really good at breaking your concentration. It'll take a long time to compile, randomly crash or take time importing things etc, which then makes you want to not sit there and watch it.


I don't focus. I get obsessed.

I start with some idea, and until I can confirm it works, or it is actually wrong, I can't stop.

This idea is there, in the background, calling for attention, so it's not something I can just ignore.


>anytime I work on something

It's probably not the case that you're facing challenges anytime you work. That's an unfair generalization that you're holding against yourself. What about the times when the work you're doing is completely within your domain of capabilities?

I keep an editor open and maintain a journal of my thoughts while working. Journaling helps me organize my to-do's, questions and concerns, and keep an index of reference material. A journal helps keep me focused.


I feel you.. I have it the same. I personally resigned on trying to solve this issue. What I am doing instead is, to have this procrastination be productive. When watching youtube, I go see coding videos, or survival. Or instead of music I go listen to Python podcasts to keep in loop on new features. Or I go solve some leetcode problems. Heck I even do chores around the house. Therefore, I know that I should be doing work stuff, but at least I am not wasting time.


I have been diagnosed with ADHD but don’t like to take meds. If I’m feeling this way I put on movies or a TV show. I got through college watching season after season of TV shows in the computer lab while I did my work. Music or podcasts help too. But generally I like programming and it doesn’t take much for me to sit there for hours doing it. Another tip try not eating anything. I get laser focused when I’m borderline starving and working on a hard problem.


1. Get rid of distractions 2. Slowly work up to longer focus times. 3. Work with a sense of emergency. 4. When you feel distracted and or anxious about the work ahead, just push through. The feeling will pass in matter of minutes. 5. It’s rewarding to be productive and the more productive days you have the more likely you’ll be productive again in the future.


Rituals.

There’s one highly specific genre of music I listen to while I code. Nothing else. If I take a break, I turn it off. If I get distracted, I turn it off. I only listen to it when I work.

I use the sandwich method of booking meetings; only at the beginning or end of the day. Also the times when I look at my emails. Slack is harder to turn off because ops so I let that one slide.

When I need to concentrate, flip on my playlist, and go to town.


Was really hoping you’d share the playlist or even the genre as I was reading your comment.


I'm not OP, but I'm pretty sure the point is the ritual of it, not the genre itself. Anything will work as long as it's specifically for working, and you don't play the music elsewhere. If you can get a subconscious link in your brain between that music and working, ideally you can be more focused when listening to it.


This is the gist of it. It takes a while for the ritual to sink in. You have to be disciplined about it at first. Eventually it will become second nature.

Now when I want to focus on coding I can throw my playlist on and get a small boost in focus.

The power of association. Our brains seem to be association machines. Smells and sounds to certain memories, times, or places. A ritual helps you deliberately build an unconscious association.


Yeah I totally get that part and I’ve likely done that over the years, but now those same playlists aren’t working for me. They were good while in Uni and first few years of working, but it seems their effects have worn off lol. So I’m always open to finding new obscure niche "focus" playlists or genres. Thank you though!


https://m.youtube.com/watch?v=8pEHrOnXwsY

Can't go wrong with relentless stuff like this


Search Jason Lewis Mind Amend, music on YouTube that I find really helps me focus. Working on something that's grabbed my attention, and understanding what it is that grabs my attention (stuff that is new, urgent, challenging, personally interesting)

However then I can forget about meals. Turn off autoplay so the track ends after 3 hours and it's easier to break away.


I've found it harder to concentrate being back at the office more post pandemic. Since someone may always pop in to ask a question, the mind always needs to be in a kind of surface / ready state - able to quickly jump into a random topic. It generally seems easier to get into a flow state when working from home (or working from the office when no one else is there).


Gonna take another opportunity moment to recommend the single most impactful secular book I've ever read: Deep Work by Cal Newport

I don't know if I have ADHD or just poisoned my boredom tolerance with years of passive stimulation, but this book genuinely changed my life, my ability to focus, and my mental frameworks around work ethic, focus, time management, and productivity.


I really struggle with this too, my whole life really. I hate it.

What I've found the only thing that works well is to have daily scrums with the small team where you say what you've achieved. The deadline makes me try to get something done every day. I think maybe having two quick updates a day might work even better.

Probably pair programming is a good solution too but I detest it so much...


I put HN into /etc/hosts and time to time I find myself automatically opening a new tab, quickly typing the URL and starting at a connection refused page. And how often that happens is concerning, but that little trick helps me to realize that I should probably focus on something else instead, like doing few push ups.

I reduced considerably these monkey brain moments.


I'm trialling Endel and it's surprisingly effective. I say this as a highly skeptical musician who gets bored easily by repetitive electronic music: I get lulled into focusing on work and an hour later, time has passed and work is done!

https://endel.io/


> I can't work on it for long amounts of time - every 15 minutes, I will either visit HN, Reddit, some game, or have to get up and physically leave the desk. I can't bring myself to work on things for extended periods of time.

This is not bad in itself. Do you actually PROGRESS in your work when you do this? If so, keep going on.


My problem is more the opposite… once I am focused on something I find there hard to stop. But indeed if I am working on something very boring I struggle to do it for long period of times (mostly because the take doesn’t require any real focus and the mind wanders), luckily for me I don’t often engage in boring tasks.


Don't leave the desk for extended periods of time. You might not be able to control you mind but you certainly have more control over your body. Just take water, food anything you need and don't leave your desk for an hour. This can really help in the long run as slowly it becomes a habit.


Having a very strong desire to get the work done is often all that I need to block distractions and focus for long periods of time. When I am less motivated, I accept it and decide on a time when I will start again. I reckon that owning the outcome helps with desire.


Was in a similar place. Try pomodoro technique to split things in quarters making life easier.


At first I thought "what? You have to remind me to eat when I'm working. This guy must just not be into his work". Then I realised there may be another factor at play that I've long dreaded may come to fruition.

Are you by chance younger than 30? It could be that people just don't have attention spans like they used to (causes have been discussed to death, so I won't regurgitate. Suffice to say; the modern web). When I was growing up, we had a lot of practice being bored, which made anything that could break that boredom precious. Scarcity cultivates focus like nothing else.

Something else to bear in mind is that you're not really supposed to be able to concentrate for more than 40 minutes at a time, it's how the brain works.


Just context switch every 15 minutes. Set up a pi-hole that blocks reddit and hn during working hours and whenever you catch yourself auto-pilot typing it in the address bar do a context switch.


Inner motivation is the real driver. If you are fascinated about a topic you will always come back to it and don't need all those tricks mentioned elsewhere (they may still help though).


Setting short-term goals works very well for me. Create the skeleton of such and such class, refactor that method, send that email I have pending and things like that.


Sounds exactly like ADHD. I can focus for as much as I want to. I start having lack of sleep problems before I lose focus.

I worked with people with ADHD (not diagnosed and diagnosed) and they all had the same problem of being unable to focus. Pairing with them was quite the experience.

Some of them switched to being product managers to retain a good pay even if they can't code.

I think you have to deal with it but don't stress too much over it (stressing about it will make it worse). In today's bs corporate world in which nobody does crap you'll be fine. Average performance around medium large companies is terrible.


Consider that your distraction-seeking might be avoidance of some (potentially deep-seated) negative emotions associated with working or the task at hand.


> I will either visit HN, Reddit, some game

Do your work on a computer that is not connected to the internet, and does not have "some game" installed.


Sometimes I can focus and sometimes I can't. Try as hard as I may, I can't seem to control when those times are.

Nothing useful there. Oh well.


I spent 10pm to 1am to finish a daily project. Very productive, during day just answer questions and attend meetings, is impossible


9/10 the problem I'm trying to work on isn't sufficiently broken down and feels impossible to even start on.

The more I break down a problem into small solvable problems (a pen and paper is all you need), the less obscure the issue / work becomes, then I can be there for 20 hours coding/designing whatever from the point I've understood what I need to do.

Also writing down where I finished and where I need to start from the next day helps me get back into work easily.

TL;DR you're probably overwhelmed and it's easier to watch sexy people doing yoga on Instagram than to actually build something.


this to me is a sign that i'm not working on the right thing. sometimes i'll go weeks without really doing anything at work because nothing feels engaging. other times a problem really grabs me and i think about trying to figure it out all the time. i don't fight these waves anymore. let them come and go.


Amen brother. I just don't know how compatible that is with someone paying your to work on something, aka traditional employment.


Break bigger things down into goals that you can accomplish in shorter amounts of time.

Don’t fight it… just make it more productive.


Adderall. Honestly.

Why can't it be the real solution?


Unacceptable side effects for some. Gave me IBS and erectile dysfunction.


What about the 4 or so alternates in the same category? Same side effects? If so, fuck.


Vim, headphone with noise cancelling listening good music : amon amarth, behemoth, jinjer, unleashed, ...


Can I strong second a good pair of noise cancelling headphones. I used the Sony WH 1000 XM3 and now use the the Sony wf 1000xm4 since the latter is in-ear and easier to carry around. The noise cancellation is phenomenal. Pair this with a mindfulness playlist from a variety of composers and your senses will be detached from distractions around you.


How about working for shorter periods of time? Why is there such a crunch to work so much?


I don’t. Until deadlines are close. Then focus comes automatically.


Get your setup right. Ironman without his suit is just another guy!


Sure you don’t have ADHD?


I have an insane amount of work to do, I cannot afford to not focus


I might know I have to look at some code or something for a few hours, but looking at my day I know it will be interrupted by meetings and lunch, and that I will probably get Teams messages during the day as well. Even if I have a block of time free, if I know there's a 50% chance I will be interrupted with an issue I don't get started.

So in this scenario what I do working from home is spend a lot of the work day that day doing my laundry or whatnot. Then after 5 PM no one will be interrupting me so I then look at the code. I probably do this at least one day every week. Maybe I shift the schedule around - I work Tuesday night and do my laundry Wednesday afternoon. This is a scenario where the interruption is fully external.

If I am not being interrupted...some things I sometimes have to kick myself to do at first, but then I can go for an hour or more. This would include going to the gym, or, I don't know, studying what a monad is. I just have to determine I'll start doing, but once I am doing it I am not distracted.

The last thing that I have to kick myself doing even while doing it. I sometimes had to do this in college - I had to do a lot of studying for something which was not my major, which I did not care much about etc., and it was purely to pass the class and get a grade. Actually these things used to get a lot of other things on my things to do list done - I'd say, I will clean the living room tonight, not study Lewis structures or whatever. There's not much solution to this other than just kicking yourself back to the task.

While things being as they currently are we always have to kick ourselves a little to do some things the whole way through. At some level it becomes psychologically untenable and you just have to face the fact that you don't enjoy doing whatever. For example - at college I enjoyed most of my Computer Science classes, reading the material, doing the homework etc. I even enjoyed some of the books we'd be assigned in English classes and that sort of thing. Some classes I did not care about, and had to kick myself to study. But that is normal. However, if I was not interested in computer science and had to kick myself to study everything, it becomes more untenable. It's not going to work psychologically or in general. Although in retrospect, some things I didn't realize the use of until later. Like my graph theory class I generally found boring, but then my next class was a data structure class where I made use of nodes and trees and graphs, and the graph theory came in handy.

Also - as some other people here said - wake up after a good sleep, shower, have a clean environment around you, eat decent foods, get a good deal of cardiovascular exercise etc. Take at least one day a week to just relax.


Dark room, a lot of coffee and no distractions


>However, I know it can't be the real solution

Why not?


The trick that I use is to take Concerta.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: