As a fellow ADHD'er, I realized some time ago that while multi-tasking, I was just doing multiple things poorly. I'd lose the stack, forget tasks, lose conversations - basically be a waste of space, except for the very rare times where I could write brilliant code due to hyperfocus.
When not on medication, I will be forced multitask, but I do so with "tasks" which require differing amounts of concentration - so I can leave one part of my mind stewing on a problem while looking at cat pictures.
Also, bosses + coworkers prefer if you always seem busy – so, while planning code, take a block of paper, and draw flowcharts, class diagrams, etc – it helps visualize the thoughts (so you keep them even if interrupted), and it makes you seem more effective.
Waiting on IO and refocusing is such a slow task that time scheduling other CPU-heavy jobs during that time can optimize performance a lot.