How to Block Distractions While Coding

How to Block Distractions While Coding

Featured on Hashnode

I'll be the first to admit: I sometimes have trouble staying focused while coding. Even though my intentions are good, I often still falter at the slightest chance of distracting myself. And to perform well doing intense and precise work such as software development, distraction isn't good - we need to remain in the context of our work environment for as long as possible without drifting off.

Here are some resources I use to keep myself focused while coding:

1) LeechBlock

You may have heard of or even used this browser extension before. It's one of the quickest and easiest ways to block unwanted websites, and it's free to boot (in fact, every resource mentioned in this article is free.)

Here are a few quick tips to get you started with it:

First, you'll need to know how to efficiently define blocked sites. In the settings page, you'll find this area where you can enter definitions of domains you want to block:


See the "Tip" at the bottom? It lists symbols you can use to list more specific entries. For example, if I wanted to block all subreddits on except for r/Programming, I would define these two entries:


This way, the distracting part of Reddit is blocked while the more useful and productive part is accessible.

I highly suggest you review the FAQ for more tips.

2) Distraction-Free YouTube

I know, I know... how are you supposed to get any work done if you're using YouTube at all? Well, It's not that simple. Oftentimes, we need to use websites that can be both productive and distracting. YouTube is filled with some amazing resources that can boost your knowledge and skills. At the same time, the app preys on your compulsiveness with video feeds filled with clickbait titles and thumbnails.

The Distraction-Free YouTube extension allows you to access YouTube without all those unnecessary bells and whistles. After installation, click on the extension tray icon and choose which components of YouTube you want to hide/disable. Personally, I choose to enable all options as my default experience:

This is what my YouTube homepage looks like at all times:

Pretty boring, huh? As it should be!

3) Minimalist Twitter

I know how we all feel about Twitter... it's the devil, it's a snake pit, nothing good ever happens on Twitter... but some people use Twitter to network, and I want to talk about a tool that can enable such people to use Twitter for what they need and avoid what they don't.

Minimalist Twitter gets rid of a lot (albeit not all) of the distracting features Twitter provides by default. Here's what the options menu looks like:

As you can see, the extension affords you a lot of flexibility in how you want to experience Twitter. Want to get rid of gratuitous stats such as like and follower counts? Sick of the app constantly shoving unsolicited recommendations in your face? Maybe you don't even want to see your feed at all (Zen Mode) and just want to focus on writing that witty tweet for the day. Whatever it is you're trying to avoid (or not), Minimalist Twitter's got you covered. I really do love this extension, and since I've started using it, I've noticed that I click around randomly a lot less. My experience is more purposeful and focused rather than scattered and distracted.

So there you have it. These extensions can help you stay focused in a distracted world. Hope it helps!

Did you find this article valuable?

Support Matthew Smilansky by becoming a sponsor. Any amount is appreciated!