It's actually a great comparison. Depression, both unipolar and bipolar, is quite common, and self-medication with alcohol and/or marijuana are quite common. One of my coworkers was bipolar and spent some time in the local hospital mental ward after a crisis, and said that most of the people there for alcohol detox were bipolar folks who'd gone off their meds (because meds are boring) and switched back to drinking until it caused them problems. Another coworker who's hypomanic said she used to need a couple of martinis or a joint to unwind in the evenings, but eventually went to a psychiatrist to get some better-tuned meds.
So yeah, some people are alcoholics or stoners because they like being drunk or stoned all the time, but for a lot of them it's really dealing with underlying mood problems that could also be addressed with prozac and its relatives. Cocaine's a bit different, but if you want to be manic-depressive and aren't that way naturally, it's a good substitute.