Yep, this is why I chose truck driving as a job. I am looking to change out of it now after 12 years, but there's no short list of 'one thing at a time'jobs, and the ADHD has prevented me from learning programming so far.
Regarding OP's question, when the tab counter on Firefox turns to infinity, I check the last ten tabs for anything really important, then take a deep breath and 'Close All Tabs'
I find I want to be doing things. Those things must be immediately (or very quickly at least) and consistently rewarding, or I'll stop. That much is, as far as I've found in the last few decades, an unchangeable fact.
That pretty much rules out studying.
You can learn by doing things too, obviously, but the early stages of learning programming are either sensible small steps (hello world, what's a function, etc etc) or gigantic unrealistic moon-of-an-exoplanet-shot projects (I'm going to build the next World of Warcraft by myself by next weekend).
The sensible small steps are exciting and give the doing things successfully rush at first, but that goes away fast and you need more.
You do hello world (wow I made the computer do something!). Learn how to use some conditions (wow I made the computer decide something!). Learn about libraries (wow so I can just stitch a bunch of these together and build the next Big App!). Start working on your big idea, quickly realise you're not going to be getting the success hits fast enough. Do something else "for a bit" and never touch your project again.
I'm fairly sure the only reason I managed to learn to code was that my first job in tech support was both easy and boring, and automating parts of that job was more fun than actually doing the job. Productive things become much easier when they're procrastination from something less fun.
It's taken me ten years, but I'm finally at the point now where I've built up a big enough skillset that I can take on projects that I'm interested in, and make progress fast enough that I get my fix and can stick with them.
There is also the part where the machine I sit down at to attempt to learn programming also happens to be the same machine where I do banking, budgeting, YouTube, Reddit, HN, porn, gaming, socialising, falling down Wikipedia rabbit holes etc. etc.
There are lots of distractions for the distractable mind.
>Productive things become much easier when they're procrastination from something less fun.
QFT.
Build it, run it.
For iOS development, that means rubbing the ink off of Cmd+R, Python in PyCharm is Ctrl+R, bash is uparrow+enter…
The feeling of extreme frustration when things don’t compile and run, met quickly behind a rush of “hell yeah!” dopamine when things work - is an adhd brain’s white powder.
However, keep in mind that over time, business success will mean not finding the next thing to battle with or to learn - it will be implementing what you know quickly towards a customer aim. There’s a pit of despair if one doesn’t keep an eye out for that.
I was the typical “well-functioning, kinda smart” ADHD-kid, who got trash grades, to many of my peers surprise.
I was too busy tinkering with electronic music production, which I guess has a similar profile to coding, in regards to instant feedback dopamine hits.
Then I got into javascript at some point.
Last year I actively chose to go back to school to study web development. Top grades now and I am super excited to go to school every day.
Highly recommendable.
I spent a few years working on a Support team, at least a couple of those years managing that team, and part of my job involved being interruptible with a very short response time, on several different channels (I mean email, IM, phone, etc.)
I liked that job as I met great people and learned a lot, but the moment I was able to shift into a more focused position (within the same company) I felt a great relief, an improvement in my quality of life, and a recovery of my cognitive skills. At that same company, I had (had because I no longer work there, we're still friends of course) a great friend, someone whom I know since we were 16 (We're 44 now), and he's the exact opposite and took the opposite path: He started off doing dev work, focusing on just a few tasks at a time, but it didn't work for him (even though he was amazing at his job) and ended up loving working as a support engineer. He thrives in an environment where he gets interrupted multiple times per hour (!!) during his work day, with no impact at all on his cognitive skills. In fact, not only is he a great problem solver, while dealing with multiple problems in parallel (and the interruptions include having to jump on a screen-sharing session without warning, something I can't tell you how much I feared and despised when I had to do that job!), he can tell you by heart the numbers of all the tickets he's working on, including their description and context. And I don't mean while working, I mean over beers at a meetup ...
The one thing we both agree on is that we love WFH and would never, ever go back to an office (he's been WFH pretty much all his life, while I've been doing that for 15 years now). And just as that is the case for us, I also know personally people who don't like WFH and need to go to an office every day in order to be productive and to feel a human connection with their coworkers.
I eventually got into 'the zone' and I was actually quite good at figuring out problems with little context, but my gumption was gone nevertheless, and I was useless for whatever thing I was working on before the interruption for mostly the rest of the day.
The context-switching is what killed me when I did that, and he actually does enjoy it, as crazy as it sounds!
prioritization and setting time limits/routines/schedules is key here imo.
I can deal with the first and last, but the second is impossible.
If your job bores me I just cannot do it.
(1) Recognize that if I'm struggling to focus, I'm probably either (a) not interested in what I'm doing or (b) have too much on my plate.
(2) If I'm struggling to focus day after day, find something else to do.
(3) If I have too much on my plate, insist that my employer lighten the load or, once again, find something else to do.
It's not easy. Taken to its logical conclusion, I'm suggesting quitting jobs that aren't interesting or demand too much multitasking in favour of those that are mostly interesting and allow you to do one thing at a time.
That's sooooo much easier said than done.
But for me, it's the only thing that works. Yes, I meditate, keep studious notes and lists, make use of project management software, take my medication... and all of that definitely helps. But it's not enough. I've found there's no solution to getting me to be productive in a job I hate, am not interested in, or demands too much and sets me up for failure. There's not enough medication or self-help in the world for that.
How much time I spend on HN is a great barometer for it. If I find myself struggling to stay off HN and do the task in front of me, I have to first look at myself and see if I'm doing all the things I know that help. And if those things aren't enough, then I know the problem is the job. And jobs don't change. Only people do.
So if your job sucks, find a new one as soon as possible. That's what I usually do, anyway.