Hang in there! Mental health is serious business, I hope you have a good professional you can turn to.
Programming is a great distractions, as others have pointed out. Make sure you don't use it to completely displace the pain you're feeling. You need to spend some time with it as well, that's how we humans deal with an it. Alternating between moments of distraction and periods of "dealing" is a good middle way, I think.
You're a great human being, never forget that.