Is programming underrated art form when it comes to helping people come out of such situations? Addiction or depression.

It easier to get paid, you can be in a flow state for hours. Enough to forget about other addictions. and less likely to be high always while programming

  > and less likely to be high always while programming
It depends on the drug. If you're an amphetamine/meth addict (or other designer stimulants), you very well might be coding for days on end. I certainly was.

It will even get to the point where you feel dependent on them to focus and "get things done", like being sober is a handicap.

Not really.

I'm a recovering addict, felon, and have depression (lucky me). And though there were times where I could work an entire weekend without stopping, it was always followed by 2-3 days of doing absolutely nothing because I was so dope sick/depressed. The worse my addiction got, the shorter the "flow" period and the longer the recovery period took.