You'll get a lot of pop-science answers when you ask about dopamine. The less popular truth is that focus and self-discipline can't be reduced to a single chemical. It's not as simple as a level in your brain that goes up and down.
Side note: ADHD is more than just dopamine, too. The stimulant medications used for ADHD have strong norepinephrine activity. There are non-stimulant ADHD medications that act on norepinephrine primarily. There are even studies where some non-dopaminergic ADHD medications outperform stimulants in certain measures like memory by modulating adrenergic circuits.
The unpopular take is that you need to realize that "dopamine" is an abstraction for higher level behaviors. It's not "dopamine" leading you to be distracted or focus, it's a behavior that you need to train and develop over time. There's also a big emotional regulation component where it helps to understand why you're seeking distractions instead of doing the work. Is it to provide comfort? Avoid uncomfortable feelings that the work brings up? Perfectionism? Are you trying to recharge during working hours because you're not recharging outside of work properly? There are many angles that need to be pursued.
I would recommend starting with small steps. Look up Screen Time settings or plugins that will limit your time spent on HN if that's a problem. Start with a generous setting and lower it over time. If you slip, start again the next time.
Treat it like something you train. Start small, make a deliberate effort, and work on getting better slowly. If you expect to flip a switch and turn into the most diligent coder you can imagine, you're unlikely to succeed. If you set a goal to do 10 more minutes of work and 10 fewer minutes of HN before lunch, that's doable. Little wins will compound.
Side note: ADHD is more than just dopamine, too. The stimulant medications used for ADHD have strong norepinephrine activity. There are non-stimulant ADHD medications that act on norepinephrine primarily. There are even studies where some non-dopaminergic ADHD medications outperform stimulants in certain measures like memory by modulating adrenergic circuits.
The unpopular take is that you need to realize that "dopamine" is an abstraction for higher level behaviors. It's not "dopamine" leading you to be distracted or focus, it's a behavior that you need to train and develop over time. There's also a big emotional regulation component where it helps to understand why you're seeking distractions instead of doing the work. Is it to provide comfort? Avoid uncomfortable feelings that the work brings up? Perfectionism? Are you trying to recharge during working hours because you're not recharging outside of work properly? There are many angles that need to be pursued.
I would recommend starting with small steps. Look up Screen Time settings or plugins that will limit your time spent on HN if that's a problem. Start with a generous setting and lower it over time. If you slip, start again the next time.
Treat it like something you train. Start small, make a deliberate effort, and work on getting better slowly. If you expect to flip a switch and turn into the most diligent coder you can imagine, you're unlikely to succeed. If you set a goal to do 10 more minutes of work and 10 fewer minutes of HN before lunch, that's doable. Little wins will compound.