Not joking: stop going on the internet. It's scientifically proven to boost concentration. More specifically, do one thing, and only that thing, for a set time period. Do not check your phone, do not even have it in the same room. Do the one thing until time is up.
Since accessing the internet (and sometimes even the Web) is often a part of an IT job, the "one thing" approach is pretty helpful. Keep in mind what are you doing. If you're reviewing a pull request, you only need the Github page, and not the rest of the pages on the WWW.
Also, timeboxing things helps. It's hard to work on one thing indefinitely, it can even induce panic. But if you're using something like the pomodoro technique, you know that when you're feeling a craving to switch, you have, say, 27 minutes left until the next break. It's observable and manageable; you can concentrate during this time, knowing that a relief is nearing. But the relief (like going for more tea / coffee / etc) is also timeboxed, so you don't get distracted forever.
> If you're reviewing a pull request, you only need the Github page, and not the rest of the pages on the WWW.
In Firefox, you can set browser.tabs.tabMinWidth to a large number in about:config, so that fewer open tabs are visible at once, which may reduce distractions.
Or (slightly more complicated) you can keep a fixed number of tabs visible irrespective of window width, by using userChrome.css to apply a style like `tab:not([pinned=true]) {min-width: calc((100vw - 12em) / 3) !important;}`
Just doing one thing at once, close all your tabs, facebook, and any other time-wasters. Then I set a pomodoro timer for 60min and work until it's done. Currently using Befocused Pro. That is the best way to focus on something that you are procrastinating on.
I've replaced a lot of my normal web surfing time with putting in some bluetooth headphones and listening to audiobooks. Much more fulfilling than spending hours on the internet where I can't even remember what I did that whole time, and you're freed up to do other things like work out, prep food, clean the kitchen, etc.
Not sure if it has improved my concentration, but it has improved all sorts of aspects of my life in surprising ways. Like I'm now the type of person who doesn't mind hand-washing all the dishes where, in my 20s, I'd let them pile up in the sink—I just do it while listening to a book.
It works. I found myself getting distracted and one day I pledged not to switch tabs or panes when a programming task involves a pause, such as getting a new build. I'd either stare at the screen or switch to a related programming task. This brought out a tremendous difference in my concentration spans.
No, you do not "have" to use the internet. Internet is very much unlike eating (unless we're talking about eating habit forming trash foods)
The best way to deal with the 'internet' is to have a seperate device - call it an "internet terminal" - connected to the internet - preferably in another room, or completely opposite side of the building.
And thus when a necessity to access a particular piece of information arises, you specifically get up and GO TO the 'terminal' to do that specific information retrieval action.
Sort of like going to a library to pick up a particular book.
Kind of like RMS does when he asks people to email/print him out webpages.
Certianly harder to pull of for people who do web-development related thigns.
Problem is, some of us goes into loops: Check email, check youtube, check hackernews, code a bit or do code review or work meeting, check email, check youtube, check hackernews etc....it can get draining really quickly, esp with the current events going on (covid, war etc).
Biggest boost to productivity at this point is to forcibly shut everything out for a few hours. PiHole helps me with this.
A few weeks ago I installed the browser plugin Intention on my workstation. It has been great, having a reminder that I am getting distracted and being given the option to be distracted on purpose for a limited amount of time.