I previously struggled with intense depression that lasted about 4 years. At the end of the four years, I had a realization that was so powerful that I haven't entered a period of depression lasting more than a week in the subsequent 4 years. My hopes are that this story, and the lesson learned by the end of it, may help others. In addition, its important to state that this is my story as it happened. I am one man, with one limited perspective on the world. I do not claim to know the details of everyone's situation and therefore do not pass judgement on their decisions regarding a very serious topic.
The story goes like this... In senior year of high school I 'formalized' my atheism. I'll save those details for another day, however, it suffices to say that I was confident that I was drawing the correct conclusion about the nonexistence of god. In thinking about the implications of a godless universe I realized the vastness of time, the insignificance of myself, and how nothing actually mattered. There is (or so I thought) no reason to do anything at all because its all going to be washed away in time. My drive to carry on vanished. Everything was futile, hopeless. Nothing I did mattered so why do anything at all -- why feel happy about anything at all?
I constantly thought of suicide. The ways I'd do it, the statements I'd try to make with it. It was an awful time, and it was all right in the middle of my undergraduate college experience. This continued on for a couple years as I tried as best I could with school while investigating how other people are able to cope with the magnitude of this concept. The reality I found was that most people don't cope with it, or rather, they cope with it by never even considering it. That only made things worse of course, everyone I'd talk to about this had almost nothing to say.
One day I decided I'd actually go through with it. As I lay on my bed I thought to myself "Alright, its been long enough. I've felt terrible and thought of suicide for years now. Either I'm going to man up and get this over with, or I'm just going to keep dreaming of doing it every day." So I bullied myself into finally committing to finish it, and there was a sense of relief. I asked myself why I hadn't decided to do it sooner. That was when I made the most fantastic discovery of my entire life, but first, some other things you should know.
During this time I was also struggling with being gay and, as a gay computer scientist myself, I found Alan Turing very interesting. It struck me as awful that he died in 1954, not long before The Beatles, free love, and the full onset of the civil rights movement. Just a few more years and he could have lived in, and possibly even helped to shape, a much more liberal society.
When I asked myself why I hadn't decided to do it sooner, I realized it was because I was never sure. I always hoped that I would find some clue that would change my mind. So I thought to myself: am I sure now? Do I have conclusive evidence that killing myself is the right thing to do? Am I certain there won't be some dramatic unforeseen shift in circumstances that would improve my life and make me not want to kill myself (like Turing missed out on)? No, I was not absolutely certain that life had no meaning.
We know so little of the universe and theres no way that any of us can be absolutely certain that suicide is the best choice without research that would take hundreds of years in understanding physics, the mind, and probably fields that don't even exist yet. Its possible that life does indeed have a purpose and we simply don't know it. The optimal thing to do is to continue on and do as best we can to discover this purpose -- because if there is a purpose, then actively looking for it is the smart way to find it. If there isn't a purpose, then the time we 'wasted' in search of a purpose wasn't really wasted after all because theres no way to judge whether it was time well spent without an ultimate purpose.
Getting back to the discovery... Probably mere hours away from killing myself, I realized that there was no way to know if killing myself was the right thing to do. There may be something to live for that I don't know about -- some overarching infallible truth embedded in the fabric of the universe that gives life meaning. This was a powerful idea: I should not kill myself because there may be a purpose of life. Now I decided to not kill myself...but what should I do next? I had no plans; after all, I had expected to be dead later that day. Well, it was simple. Nothing mattered except the thing that had kept me alive: the potential for a purpose of life.
I realized that every bit of my life should be based on discovering the purpose that may be embedded in the universe. The most important thing, the driving factor in all aspects of my life, indeed my very own reason for existence and purpose of life was to discover the purpose of life. "The purpose of life is to discover the purpose of life." It is beautiful.
There are many questions and implications that come from realizing this purpose of being alive but for now this comment is long enough. If you're interested in hearing more, let me know. I've thought a lot about this and (in true HN fashion) am building some tools which use ideas that stem from this one. I hope that my story of how I walked right up to the precipice of death and decided to turn back to life helps anyone who is also struggling with such issues.