I've been diagnosed bi polar, anxiety, depression and OCD, but I really don't think I am very OCD. I am but not to a point where it interferes with my life in any way whatsoever, which is why I think its ridiculous that doctors recommend I take heavy psyche meds for it that will definitely interfere with my daily life.
as far as anxiety and depression go I am doing much better now, I had it really bad but when I was around 19-20 years old I got off all psyche meds and began trying to 'fix my brain.' I didn't know it at the time but what I basically did was some intense CBT(Cognitive Behavioral Therapy - google term that I suggest anyone with these issues should look into) on myself.
The one thing I can't shake is the manic/depressive stages I go through as a symptom of bipolar disorder. I don't take meds for that either, I don't like being on psyche meds in general and I find I am a lot better working with my 'mental illness' rather than against it. A lot of very successful people were bipolar, especially in creative fields. depressive phases are a HUGE stunt to my productivity, I am basically out of the game completely for a couple weeks every couple months but I think that I more than make up for it when I get really manic and stay up for 72 hours coding, for some people this can be dangerous as sever mania can lead to psychosis - which for me is the only symptom I would consider serious enough to be worth trying medication for - but the only time that has happened to me was when I was on ssri's for depression(ssri + bipolar = extreme mania).
These issues have certainly set me back a lot but only because I let them. I wasted a few years of my life where I could have already been in college and learning but instead I was doing 'other things,' I'll just leave it at that. Now I am doing fine, I'm going back to school and doing really well with little effort and I've learned a TON about programming on my own in the last year.
As someone who has gone through it all and been everywhere from institutionalized to homeless to literally dead for a few minutes, but is now supporting myself and paying my way through school as a freelance programmer and getting straight A's the best advice I can give you is this:
Don't look at yourself as a bipolar person or a person with adhd or whatever. Those are just words made up to classify people with similar behaviors that are different than normal. If the majority of people were bipolar then we'd be calling the ones who didn't have it excessively flat or baseline and we'd make up a diagnosis for it. As person with psychological diagnosis your main disadvantage is living in a world made by mostly 'normal' people, which therefore is obviously designed to be most suitable for other 'normal' people. But don't let that stop you because every unusual quality someone has is a disadvantage in some ways and an advantage in others. When you start to recognize your limitations and your abilities you can set goals specific to yourself, goals that would be more difficult for people without your quirks, and work towards them, working along with your unique psyche instead of trying to suppress it and do things the normal way. It really is a sin how many people live their whole lives unhappy and as underachievers because they are trying to do things the 'normal' way instead of being who they are, Never let anyone make you think that you need to be 'fixed.'
Specifically relating to programming, I feel like some parts are much easier for me than other people and other things are more difficult for me. I was never diagnosed as adhd but I have the symptoms and they really effect my ability to sit down and just work. Forcing myself to think linearly and follow one train of thought to solve a problem is doable but it drains a LOT of mental energy. If I'm doing that kind of work I need to take a few breaks every hour and walk around for 5-10 minutes. But I am a great problem solver and a great architect, if I do say so myself. I never have to turn away from a problem that seems really complicated because I know if I think about it enough I'll find a solution as long as one exists. And architecture is just something that seems obvious to me. I see much better programmers than I asking questions about architecture or making decisions about it that I just don't understand how such a good programmer could not see things that seem so obvious. Those are definitely my strengths but for every strength I also have an equal weakness that I have to deal with. After a while you start to find techniques to play off your strengths and minimize the impact of your weaknesses and once you get good at it you'll surprise yourself. One way to look at life is as a big optimization problem/
Sorry for the long post and excessive quotes when talking about 'mental illness,' as you may have guessed this is a very manic week for me
. I hope your not sitting there reading this and thinking 'Oh god, I'm gonna end up like that guy!'
EDIT: I think latch's short post was much more helpful than mine. Just wanted to emphasize his points