The distracting world of software development
On a typical work day, I get interrupted from what I’m working on about 9000 times, or about once every three seconds. At this point I’m a pro at getting interrupted.
Now, obviously, this is hyperbole, but the point is valid. As developers, there are a lot of different pulls on our attention. Of course this isn’t unique to developers. But as tech companies move to open floor plans, the need to be able to focus, despite those distractions, is growing.
I’ve focused a lot lately on the idea of mindfulness while coding, but it is easy to see how distractions can prevent that. Any interruption can snap you out of your focus, and suddenly you’re rabbit-holing down a path you never intended.
Ideally, we can remove our distractions. I’ll touch on a number of ways I personally attempt to remove distractions from my work.
The first type of distraction we’ll need to deal with is external. This is interruptions coming at you from outside your control.
My number one way to attempt to block these interruptions is probably everyone’s most common. Headphones. You simply have to get yourself a decent pair of headphones as a developer. This is crucial even if you don’t listen to music! Other than drowning out background noise, headphones provide an immediate visual cue that you are in monk mode. They say, “Now is development time”.
Of course, they don’t always work. Not only will some people not respect the headphones, sometimes people just consider their thing the priority. Hopefully, your office provides you some side rooms. At my office, these are called “JITs”. Anyone can grab these rooms at any point and just work. If your office doesn’t provide these, I recommend getting cozy at Starbucks.
These strategies can help reduce the interruptions caused by drive-bys, but Slack and other applications can be just as annoying. I have two main strategies for dealing with these.
Number one, block off your calendar. Put time on your calendar for dedicated tasks. If you need to write that new feature, put a spot on your calendar specifically to work on that. This does two things. One, it prevents others from scheduling time there, and notifies them you are busy. You can also put up auto replies and go away on slack if that helps. But two, it sets aside mental space for you to work on that task.
Two, turn off notifications. This has a bigger effect than you might realize. I actually do this in most of my life, but at least temporarily disabling notifications on your laptop can be a big deal while trying to focus. Slack, especially, has a tendency to be distracting. On mac, use do not disturb mode.
For me, this is the harder one. Narrowing your focus to just the task at hand. I have multiple tricks I do to this end. In fact, turning off almost all notifications, which I mentioned previously, on both my phone and laptop all the time is something I do to help this.
Not everyone is willing to take that plunge though, so that’s where focus apps come in. There are a variety of these out there, but here is one: focus booster. These apps work by blocking access to a variety of typically distracting sites. Facebook, reddit, twitter, these sites aim to keep you locked in them. As a result, they are addicting, and sometimes we need help to stay off them. These apps help with that.
This next tip will probably be met with some resistance, but hear me out. Switch to a single monitor setup. Using one monitor keeps you focused on the one thing you’re working on. If you can’t do that, use two, but position one directly in front of you. I’ve seen many developers position the second monitor vertically, this also helps delineate which monitor is your focus. But nothing beats a single monitor for this.
To enhance the single monitor lifestyle, use full screen apps. This keeps you in the app your working on. Get good at alt-tabbing (on windows) or switching desktops (on mac). This has been one of the best hacks for my productivity. Not only does it make the app easier to use, it keeps you constrained in the app. No more checking Facebook on the side.
Dealing with distractions
As we all know, not all distractions can be prevented. Sometimes we just have to deal with them. This is where things get difficult. We may have to break social norms. We may have to attempt to dislodge the status quo.
The biggest single thing you can do is learn to say no. Often, when coworkers come to you with a request, it can be hard to turn them away. But when you’re really focusing, this can be the best way. Take a note of it, and move on (I mean a literal note). Follow up when you’re not focusing. Or don’t, because the likelihood is that it isn’t a priority for you.
This can be hard. We want to help others. But you have to know your boundaries. Deliberately setting those boundaries can go a long way to know when its ok to let yourself help someone.Those boundaries can also enable us. Use those boundaries to set expectations with others. Tell them your boundaries, and they will respect it. This can help remove the awkwardness of the no all together, you never even get to that stage.
Finally, mindfulness (you knew I’d come around to it eventually) can help us realize these moments. Oftentimes, when these interruptions come up, we react without even thinking about it. If we can slow down, and take the time to see what is happening, we’ll be better for it. Mindfulness can be the key that enables you to say “no”.
How do you remove distractions?
These are some of my techniques, but I’d love to here yours. For me, this is a constant learning process, and really no two people are the same. Some techniques work with some people, some with others. If you’d like to share, drop a note in the comments!