Ask HN: How do you stay focused at work?

47 points by firstSpeaker ↗ HN
I am looking for a way to keep myself focus at work. I am very much multi-tasking and that is coming with the overhead that it has.

I wonder how the HN community deal with that and if Pomorodo technique is something you are using and recommending.

54 comments

[ 4.6 ms ] story [ 110 ms ] thread
As someone with ADHD I self trained to stay on one thing until it's done, or I make a good progress. I make small breaks to look a bit online, respond to messages on the phone, eat, smoke. At about two hours I take a 10 minutes break. Than back to the stuff I am working.

It required some discipline, but now it is easy.

The harder is with context switches, calls, meetings, whether planned or not, colleagues asking for something, boss asking for something. Context switching kind of lowers my ability to be focused.

Plan major work in 3 hour chunks. Have a snack and pee before you begin. Check texts. Mute notifications.

Have water and a drink of choice (coffee, diet cola, tea) prepared for your journey.

A big productivity booster for me was using /etc/hosts to block distracting websites. Like Hacker News haha
The noprocast setting under your HN account is easier and works across devices.
Apparently, it’s not working right now, right?
Pair-programming works wonders for this if that's an option.
Also, definitely don't multi-task and _definitely_ don't context switch, even if that means doing nothing for 10 mins while waiting for CI or whatever. It may feel like you're wasting time but it's nothing compared to the time wasted doing context switches.
> I am very much multi-tasking

Don't.

Here's what has worked for me:

Workspaces - I use Ubuntu with Gnome, and I set up three workspaces: one for personal stuff like Hacker News, a middle one for work communications (email, Slack), and a third with the tools I actually use for my job. This way at least I don't have distractions staring me in the face all the time when I'm trying to work. A step better would be to use a separate computer for personal stuff and to keep it suspended or even powered off.

Social media - I removed all social media apps on my phone so now it only bothers me for texts and those annoying ubiquitous spam phone calls which I can easily ignore. I deleted Facebook ages ago and I hardly ever look at Tweeter.

Segmented browsing - I use Firefox for personal stuff and Chromium for work (I'm not a front-end web dev). When I need to concentrate I can run `pkill -f firefox` and get rid of that distraction while knowing that I can get my tabs back later.

Structuring tasks - Break tasks up into chunks that you can finish in an hour or two. Make lists and check boxes. It's important to feel like you're making some kind of progress. A big amorphous blob of project is a barrier to getting started again.

Accountability - I've been working remotely for 11 years now. I had a real crisis of focus and ennui early on, but then I went to my boss and asked for twice-weekly meetings. It really helps me to know that somebody is going to ask about my tasks, plus it's a nice social time.

Exercise - Nobody would mistake me for a fitness enthusiast but I concentrate much better if I do at least basic exercise every day. A walk around the block is great for clearing my head, and I sometimes get ideas while outside.

Housekeeping - Tidy up your workspace. Run apt-get updates. Keep some simple tasks around for when you have low mental energy. The equivalent of dusting or sweeping the floor.

Acceptance - I'm reading HN right now. It's okay, I can't sustain focus forever. Skimming the tech trades can give you a sense of what kinds of things other people are doing and what new tools might be out there. Keep track of interesting things using Pinboard or django-linkpile or something. Over my career I've had lots of times where the solution to a work problem came from something I read in a Slashdot or HN post or comment.

I read something by mid-1600s monk Brother Lawrence a long time ago. A novice monk was having trouble focusing during his prayer times and was told to go seek his advice. Brother Lawrence basically said don't beat yourself up over it (certain monastic orders would self-flagellate to try to purify themselves), but just acknowledge that you've lost focus, ask the Lord for forgiveness and strength, and get back to it. You will lose focus. It happens. Don't beat yourself up, take a short break, and get back to it. Speaking of which...

Seconded regarding workspaces (multiple desktops for me, on Windows).

I also like to have the code editor/IDE open on the left 2/3 of the screen, then the terminal window in the top 2/3 of the remaining right hand 1/3, and finally a text window (Notepad, similar) open in the remaining bottom right quadrant. In that notepad window I keep a running list of my next steps, checklist of things to figure out or get working, and also paste handy command lines I'm using, identifier names from the code that I might want to search for (yes ideally the IDE would have features that make this unnecessary).

If I need to web search (e.g. SO, API docs) for something I use a browser window with one tab, in the coding desktop and minimize when I'm done.

With this approach if I have an interruption, I flip to my interruption desktop where my email, slack live, then when I flip back everything I need to get back into context is on the top layer of windows, I consult my checklist and carry on.

What works for me is a playlist on Spotify.

Putting the earphones in and listening to music gets me in flow.

I don’t tend to listen to music at other times.

Completely contrary to Peopleware, but I find that too much silence is just as distracting as too little. I get disturbed by my own thoughts and the music trims them down enough to get the work done.

I am a hard rock and British heavy metal junkie. That's ALWAYS been my go-to for when I want good tunes.

However, whenever I need to focus on a work task, I listen to Trance dance music as it's really effective at helping me focus and stay on the zone. I think it has to do with the BPM matching my typing speed or something...

> However, whenever I need to focus on a work task, I listen to Trance dance music as it's really effective at helping me focus and stay on the zone.

Ditto on the trance. I usually go with late 90's/early 00's classic trance.

I'll occasionally mix it up with some video game music, often orchestrated versions. The Final Fantasy Distant Worlds series is great. Also, the "lofi/hip-hop beats to study to" playlist on Spotify and YouTube is popular for good reason.

Mental math is great for training your brain to stay focused.

Also, do whatever you can to be healthy. That's quite a broad topic.

Accept that "work" does not mean 8 hours a day heads-down actively writing code. Humans did not evolve to spend 40 hours a week staring at a box of light, mashing plastic buttons while slumped in a chair and if you can't do that it's an attention disorder. The six hours of what managers might call "non-productive" time in my day is requisite for the two hours of "productive" code-writing mixed in. That's 8 hours of "real work" in my book, and I would wager higher quality than that of someone who forces themselves to just grind out code against their body's will.
Yeah, my answer to this is "I don't".

If you're even a little bright (which is the most I, personally, can claim) and capable of actually Getting Shit Done when you are working (so, you do, in fact, know your shit, and have decent sense/taste for where to apply effort), surprisingly few hours a week are needed to maintain or even exceed par, lots of places.

[EDIT] Though I guess my main technique for ensuring fully-actually-working time is effective is that I'm fairly serious about tightening feedback loops. This is basically like doing your mise en place when cooking. Make sure as much working time as possible is actually working, and that you can do a write-build-test cycle as fast as possible, make it easy to hop in and do five minutes of work and truly accomplish something, et c.

Can confirm, this approach works outside of tech as well. Not just buckling down to get shit done, but be proactive enough to anticipate what’s coming and when so you don’t get buried. Don’t let your in box fill up, look available on IM, answer the phone when it rings, streamline your processes. And then otherwise take the rest of the day off except for anything new that may pop up that you can knock out.
Just so you are aware, this is not a luxury that many jobs outside of tech affords. My previous job gave me way more than 8 hours of work to complete in a day and was completely tone deaf for years about widespread morale issues(insurance adjusting for a company who’s spokesperson rhymes with Bo). So I went to a new company, doing a similar job and they give me what they think takes 8 hours but usually really only takes me around 4-6 hours. My point is, some companies will just work you to death and others are either naive or compassionate(probably naive). You need to find the naive companies to work for unless you want to get taken advantage of.
And some companies give you exactly 8 hours of work. I once had a job working in a 90 degree warehouse taking boxes out of boxes and putting them in other boxes. 8 hours on the dot. Clocked by the minute. Everyday. To this day I don't take for granted being stressed out working "overtime" software projects.
Whenever I feel sluggish at work, I take a few minutes to re-watch the hacking scene from the motion picture "Swordfish". This is enough to get the adrenaline going and gets me over the hump. Adopting this routine has had big positive effects: Finagling JSON/YAML, troubleshooting time zone bugs, performing hundreds of Docker builds, and performing daily maintenance on CI pipelines has been positively affected.
I have got to re-watch that movie. Definitely a top ten for me.
Don't multi-task and have work you want to do.

If you're multi-tasking then you're doing a lot of crap work that should be automated, or at least processed sequentially. One at a time. Use a list, don't go to the next one until the task is done. If it can't be completed put it on a new list with reasons why. Follow-up. Prioritize.

If you keep getting work you don't want to do, change that. Distraction gets the best of me when I have no interest in what I'm assigned. (edit: clarity)

If you don't like what you're doing, change your relationship with it. Don't go through life just coping with your responsibilities, try to shape them to be responsibilities you enjoy doing. That might be at a new employer, new city, new significant other, etc.

Use tools (medication, timers, etc) to help build the path, but they shouldn't be the wheels you depend on to move through life. Use your head and your own two feet.

sometimes when I get like 3 hours of nonstop productivity in, I realize its because I left my phone in the other room
One very minor hack, I have a few little desk toys (piece of bicycle chain, a spinner, some plastic blocks). I used to switch to another task while waiting for those 2-5-10-60 second type waits (a pipeline, code compiling, whatever) and then find myself lost an hour later. Now I try to just stay in the task I'm working on, even if I'm waiting for the machine. Grab a toy and watch the progress bar.

Another thing I've learned from work somewhat, but primarily from exercise-- habits build amazingly quickly. It's easy to feel like "there's no point" in not following a distraction, because you'll never be able to fully break that habit anyway. But seriously, a very small amount of repetition makes a new "normal" way quicker than you'd ever expect. Thinking of giving in to a distraction? Just don't. Just this time, don't. Do that enough times, and you have a new normal. And even if you only do it the one time, it was a success.

Personally, what works best for me is a bit of a reverse. I will break my day up into 3 hour chunks but I plan my breaks more than those work chunks. I know what has to be done in those chunks. Focussing on each 20 min break means I can get all of my hackernews reading one, quick scan of my inbox and social media. It could also be a walk and a call with a friend or a cup cake :)
People don't multitask no matter what they claim. They task switch and take a long time to switch back. Don't allow yourself to go to non-work specific webpages on your work computer. That will help you to focus.
The TRUTH is...

- There are a lot of different systems, you need to find one that works for you.

- Nearly everyone struggles with trying to focus when there are so many things demanding our attention, prioritizing is what helps you focus on what's most important.

- You're human and there will always the temptation to switch to the new "app" because somehow a new company has figured out how to get things done. In reality, it's always a struggle.

- Reading a new article about how to focus is like reading a book of how to run a 4 minute mile. You need to get out there and struggle and find what works for you.

- AVOID the online BS that people tell you about how their day is so planned out. 4am wake up, 4:30am workout, 5am get ready, 6am study (it's mostly nonsense). Life is too unpredictable to be able to follow that 100% and if you plan your life like that you'll be let down when reality strikes and you miss something on your scheduled because a friend/family/coworker needed help with x.

How do I manage my life? One word, Todoist.

- Make projects, add things to those projects with a date that you'd like each done and give it a priority. - Look at the Today screen and do the highest priority things first.

What benefit does this system add?

- You'll always know what's most important and where to spend your attention.

> 4am wake up,

I would rather die.

(comment deleted)
When I really need to focus, I power up https://brain.fm/ . It's more effective than regular music for me, and within a few minutes I'm typically zoned in and in the flow.
Love brain.fm

It's magic how I get into a flow after acouple of minutes and get dine so much more so much quicker

Personal hack: keep a physical journal and make it my central place to manage everything. Close tabs frequently and write down what information I actually need. No screentime for 60-90 minutes before sleep, and plan out the first 3 hours of the next day precisely.
Don't multitask. Just do one thing at a time. To have full focus I turn off all notifications by setting my cellphone to do not disturb. Then I put on my headphones playing some cool background music without lyrics. The music helps me get in the zone most times. Essentially I don't multitask.
When I know I'll be working on mundane tasks I usually plan ahead to also have something interesting to switch to when I do my daily/weekly planning. I don't context switch that much during one task but when I'm stuck at something boring I find it easier to work on something else for a while and then come back.

Or, if that's not an option, I throw in a playlist and try to complete that task as fast as possible. And if that keeps happening I talk to my boss to work on something else instead.

I work from home with a personal system and my work system on the same desk/monitor. I swap keyboard mouse and monitor with a kvm to swap systems. I work in 2-3 hour intervals, and take breaks in-between to play games or putter arround the house and let my brain refresh a bit. It's done wonders for my productivity. It's also very helpful to set a goal for each work "session", aim for something you should be able to easily achieve during that time.