DEV Community

Cover image for On Dealing with Anxiety and Depression as a Developer
Michael Scott Hertzberg
Michael Scott Hertzberg

Posted on • Updated on

On Dealing with Anxiety and Depression as a Developer

UPDATE NOV/18: Follow up video

I've suffered from depression and social anxiety disorder since I was a teenager. I've gone through several phases in my life on many different medications to help it. Despite all of the challenges, I've grown to become a professional working software developer making competitive income.

It took me a very long time to find a combination of medication that worked for me. To be honest, I'm still trying to find the right combination. It had always been a struggle trying to balance my professional and personal life. I recall many moments where I've had to provide an excuse to my boss as to why I wasn't coming to the office today. Not because I was sick, but because my anxiety was so strong, that the idea of leaving my apartment was impossible. Despite being in and out of psychiatrist offices and therapy sessions, trying to find the right fit was the hardest part.

Seek Help

The first step that really did something for me was to seek help. I knew it wasn't something that I could handle by myself. Being in the U.S., health insurance is not free. I'm fortunate enough to receive health benefits through my company, but not everyone has this luxury, especially freelancers. I would say the biggest hurdle in finding help, was covering the cost. What turned me off the most during the search were some of the quotes I received. Don't let that discern you. Despite one phone call quoting you $600 for an initial consultation, the next one might be free.

If you have insurance, check to see if you have out-of-network benefits for mental health. If you don't have insurance, search for local community health centers that provide sliding scale payment options. Group therapy is also a cost-effective option that I've done and still do.

Stay Busy

In 1999, Devon Sawa and Jessica Alba starred in a favorite movie of mine, called Idle Hands. It's about a slacker teenager who's right hand gets possessed by a demonic force. A literal interpretation of the saying "Idle hands are the devil's workshop." which the movie makes mention of.

Having a clearer head while on medication, for me, allowed for dealing with the depression in a more positive way, by staying busy. The more I stayed busy, the less I was overwhelmed by the depressive symptoms. I did what I enjoyed doing the most: programming.


Something that I realized that I didn't do properly was breathe. When anxiety sets in, I start to hyperventilate. My breathing becomes very erratic and It feels as though not enough, or too much air is passing through my nostrils. It took many years before I came across a simple little book called "the art of breathing: the secret to living mindfully," by Danny Penman, PhD. It begins with:

Six Paragliders are
circling like eagles on
powerful currents of
rising air. Far below,
a cluster of children
gaze with open
mouths as the giant
parachutes dive and
swoosh silently above
their heads.

. . .

Then, suddenly,
something starts to go

My heart dropped. I was already captivated by a relatively short 100-page book about breathing. After reading it, I started to realize how much calmer I felt when I breathed properly. As I finally started to breathe, I started to feel that I had more control. Having more control started to make the anxiety lessen its grip on me.

Create Positive Habits

While I sought help, stay busy and breathe, none of this did any good unless I practiced it regularly. I have to ensure that I go to my psychiatrist weekly and ensure that I go to my therapy sessions. I try to make sure that I'm breathing properly and I try to make sure that I do push-ups everyday. I try to form positive habits that I only could have formed once my mind was in a better place. Habits can be created out of nothing. Start one today and consistently try to do it everyday at the same time.

As I start to breathe better, be less anxious, really combat my depression and stay busy, I start to realize that I'm in control. Not the anxiety or depression.

Although these tips cannot diagnose or cure any illness, I hope they act as a gateway in helping you in whatever situation you may be in. Know that you aren't alone and that there are understanding ears out there.

If you feel that you are at risk of harming yourself or know someone that is at risk of harming themselves, do not delay in seeking help.

U.S. - Call 1-800-273-8255 or
Outside-U.S. -

Top comments (34)

jeremy profile image
Jeremy Schuurmans

Thank you for writing this. Anxiety and depression have been a struggle for me as well. Programming has helped me through it in so many ways, but not completely, and it’s comforting to read that I’m not alone in this experience.

ben profile image
Ben Halpern

As I start to breathe better, be less anxious, really combat my depression and stay busy, I start to realize that I'm in control. Not the anxiety or depression.

That's a beautiful thing to read

yucer profile image
yucer • Edited

Some stuff to test in those cases:

  • Improve your diet (Eat vegetables, reduce the amount of daily sugar, coffee and stimulant substances). Try to get more knowledge about healthy nutrition.

  • Make exercises.

  • Sleep well and enough (google for: Sleep trick and tips).

  • Check your work ergonomics. Take breaks in the working sessions (I use Workrave other people just drink water enough so your bladder remember you to take the rest and go to the bath)

  • Improve your concentration capability (prepare the workplace, google for "Concentration techniques" to find more....)

  • Organize your work and plan it (You can use GTD tools like GTG, Outlook or Thunderbird tasks, Trello, etc.) Give you rewards for the achievements.

  • Try always to improve your estimation so you don't underestimate the effort and take a commitment for unrealistic deadlines. Some times the one that underestimate the complexity, is the stakeholder that think you just have to put a new button and that is easy.

One tip is thinking about the coding tasks that needed more time in the previous works, analyze why and estimate if those factors will affect you the next time.

  • Socialize with your workmates, or anyone you have the opportunity.

  • Look for a hobby, or a second income activity. If your life depends on a single strategy, you can be affected by the fear of "What if I fail ?"

  • Don't work on Sundays !

I have focused most on some activities that give us more productivity, remembering this quote of HARLAN MILLS:

Mankind, under the grace of God, hungers for spiritual peace, esthetic achievements, family security, justice, and liberty, none directly satisfied by industrial productivity. But productivity allows the sharing of the plentiful rather than fighting over scarcity; it provides time for spiritual, esthetic, and family matters. It allows society to delegate special skills to institutions of religion, justice, and the preservation of liberty.

If after all of this you still have anxiety, then look for a psychiatrist.

If you don't have medical coverage, then go to religion. Most of the religions have thousands of years of experience helping people to reach the spiritual peace.

iguza profile image
Yoghaswara Nugroho • Edited

I usually take a glass of tumeric milk or lavender tea,it work good for anxiety attack but make you sleepy.

revskill10 profile image
Truong Hoang Dung • Edited

I love my working room from home. Many oxy to have deep breath !

lynnewritescode profile image
Lynne Finnigan • Edited

Great article. I suffer from anxiety and depression, it's a vicious cycle. A difficult thing for me can be concentrating and focusing at work when your brain just doesn't want to code! And trying to explain/justify your time and why things are taking longer than usual is tricky - causing more anxiety.

balazsbotond profile image
Botond Balázs

Great article. It takes a lot of courage to write about this topic. I saw this fantastic talk about coping with mental illness by Sara Vierra at a conference this year which might be helpful:

smclallen profile image
Shelly M

I'm so glad you wrote this! I've been struggling with deep depression and fibromyalgia for 30 years. It's easier now with all the practice I've had! But it has interfered with my career so that I now rely on disability and I code as a way to keep my sanity and hope alive. Programming takes so much concentration that it provides an escape from both my painful thoughts of self-doubt and my physical pain.
I especially appreciate your willingness to share your experience. I know many would keep it private to avoid stigma. I kept mine private for a long time but over the past 2 years I've learned to share it with practically everyone around me. The biggest surprise about my opening up is that there hasn't been single negative consequence and I've found a few others suffering as well. We now commiserate together and share coping strategies! I'm very happy that breathing works for you! Singing helps me, I think because it forces me to breathe and it's a very social group effort. Anyway Thank You!

mshertzberg profile image
Michael Scott Hertzberg

Hi Shelly,

This deeply reminds me of Brené Brown. She did an incredibly powerful and viral TED talk about the power of vulnerability:

I'm sorry about what you're dealing with. I as well have a friend who suffers from both depression and fibromyalgia. They are both indeed debilitating and support from others is extremely valuable.

As long as everyone finds what their best coping skills are, that's what really matters. I'm glad that you have your set of coping skills to get by, and I know that it can be hard sometimes when the coping skills can't come into action. That is the sine wave of all of this. The ups and downs. But there's also the recognition and radical acceptance that there indeed will be both ups and downs.

ferricoxide profile image
Thomas H Jones II

While depression supposedly isn't as common in men as women, it seems like its prevalence is over-represented in the tech field.

I've been lucky enough to have been dealing with endogenous depression and overall anhedonia since I was a toddler (wish I was exaggerating). In all that time (I'm 48, now), never found any chemical fixative that worked for me. Even if one didn't turn me into a zombie and would manage to start making me feel less at the bottom of a well, that's when the other side-effects you didn't previously notice would start to rear their head. Worse, the personality changes from the drugs always contributed to that "who am I" feeling &mdash, that whole "are these my thoughts/emotions or the drugs'?" I also tried talk-therapy for a number of years with a few different practitioners. Was never really convinced that it did much more than blunt some of the bottoming out.

On the plus side, it all helped to really develop and keen edge of sardonicism to my personality. And, all those efforts at trying to find something that provided a spark to life meant that I forced myself to experience a lot of things that few of my peers have or likely ever will. All that time spent trying to keep my mind too busy to let the demons have unfettered access to their playground also meant I've done fairly well, professionally (even if the work/life balance is comically off-kilter). I'm also lucky enough to have come through it all realizing that, while I have depression (it's a part of me), it doesn't define me). In some cases, these kinds of things are the best you can hope for.

While I don't wish anything similar on anyone — not even my worst enemies —, reading posts like this do provide a bit of salve. There's a measure of solace in knowing that what we feel isn't as singular as it sometimes seems.

jfrankcarr profile image
Frank Carr

Question for you. How have you been able to avoid having unsympathetic, maybe even toxic, managers put you on a dreaded "Performance Improvement Plan" when your anxiety and depression have pushed you to the edge?

While taking an action like this is often questionable under ADA, it is difficult to find an employment attorney who will take a mental health case. Plus, suing a current or former employer for an ADA violation could have career limiting potential.

mshertzberg profile image
Michael Scott Hertzberg • Edited

Hi Frank,

To be honest, I've had to leave a job at a very well known company — where I really wanted to work— and I had an unfortunate experience because of an unsympathetic manager. He wanted my butt in that seat everyday. I had to leave. I would encourage that you do what's healthy for you.

pabiforbes profile image
Pabi Forbes

Hey Micheal,

I did the same too. The company I was at was a great learning environment for me, but because of the unsympathetic manager, I decided to leave too as it had started to not only affect me mentally, but physically too. It took a lot of courage for me to take the leap since I am a female in tech, and I was fresh out of varsity.

I would also encourage Frank to put his health first. :)

rapidnerd profile image

Beautiful article, after dealing with both of these for extensive lengths of time I finally found that programming was a calling I needed. A place to escape, keep my mind busy and have fun while doing it. It's helped me in so many different ways from just changing my outlook on how I see things to being able to solve some of the problems that came into the mind while dealing with these.

If you feel that you are at risk of harming yourself or know someone that is at risk of harming themselves, do not delay in seeking help

Speaking to someone is one of the best and scariest things you can do while going through depression and/or axiety. Whether it may be someone you know or related to or just a complete stranger the feeling of finally being able to get out all your issues, feelings and having someone there to genuinely listen and help you, well there's no better feeling.

Thank you for making this article Michael, I'm sure it will help a lot of people.

jimsy profile image
James Harton

Thanks for this great post. It's a subject that I also care about an awful lot. It might also be worth mentioning that OSMI provides some great resources for helping deal with mental health issues in the tech industry.

umesh1134 profile image
Umesh Kumar

Social anxiety and depression combo are worst. I face that every day.

__gower profile image
James Gower

Thank you for this. It sounds strange, but i'm sort of glad that i'm not alone in this battle. Hope all stays well for you mate.

fardinhakimi profile image
Fardin Hakimi

I am also battling with anxiety and depression.

One thing that has really helped me has been joining a gym, working out everyday considerably lowers my anxiety level.

albertico88 profile image
Alberto Grau

Thank you for sharing.