I remember a CEO of one of my early startups would give me 5mg addies to help me get more done. I appreciated it because it was great to get the added boost to focus.
I eventually worked my way up to taking 30mg of XR daily (legally, doctor prescribed) and it was the most productive I have ever been in my life. I worked 24x7. I was working a normal consulting job while also working on a startup/app in my spare time. I did ui/ux/frontend/backend/api development and sent cash overseas for an iOS developer that I managed. None of this would have been possible without stimulants.
It's only way to do some of the things that the really successful engineers are doing. You forgo eating, exercise, etc... and spend 110% of your time on working and chasing the high of getting shit done.
It's not sustainable though. I eventually went cold turkey. I do NOT recommend that as it will completely ruin your life for 6 months to a year. I was not productive, I gained tons of weight, my self-confidence went to shit. My life really went into a downward spiral.
Now I am 100% drug-free and am not at the same level I was back then, but I am very productive and focused. I would not go back to where I was, even for the productivity gains. I eat clean (low-carb, ketogenic), weightlift in my basement, row 5k/10k every few days for cardio. My only vice is really coffee and the low-carb cocktails on weekends. Best of all, I do not wake up in the morning needing a tiny pill full of amphetamine salts.