I struggle with depression, like a lot of people (a lot more than you might think too). I use code to help myself cope. It helps me because:
I share my experience not because I think my methods of coping will work for every other developer with depression, but because I hope they might for some; and because I think we should be more open and transparent about depression. It's a thing, a lot of us deal with it, and that's normal.