How Learning Programming Can Help Your Mental Health

James Frew 30-10-2019

Formal education is good for many things; college, a job, a tick on your resume. However, it isn’t so good at preparing you for life. Many of us miss out on essential skills that are in high demand, like programming.


It’s also true that many of us will suffer from mental health impairments or mental illness throughout our lives. While it’s almost impossible to be fully in control of your condition, there are ways to support yourself.

If you’re after a way to help your mental health and have an interest in programming, then keep reading.

Practice Cognitive Behavioral Therapy Techniques

CBT spelt out on lettered dice
Image Credit: Elf+11/DepositPhotos

Cognitive Behavioral Therapy (CBT) is one of the more common non-pharmacological treatments for mental health problems. Although no medication is involved, CBT aims to help you reduce negative thoughts and feelings, and to develop mechanisms to help you to cope with different emotions and problems.

Although there are programming jobs where you need to turn up to an office, there are many remote programming jobs in demand right now 10 Computer Programming Careers and Jobs That Are in High Demand Looking for a career in programming? Here are just some of the best paying coding jobs that you can apply for today. Read More . Programming is a relatively solitary task too, which can either end in elation if your code works, or stress and even spiraling thoughts if it doesn’t.


Despite the risks associated with programming, it can also be a great way to develop and test out the skills promoted through CBT. While CBT is often a prescribed program, it is possible to complete online courses or even learn the skills yourself through self-help books or research. If you’ve ever been stuck in a cycle of negative thoughts about yourself or your abilities, you may be able to develop skills to manage them through programming.

Of course, it’s easy to stay positive when things go right, and your code executes without a hitch. But when it doesn’t, using CBT techniques to manage those feelings will help you out. You can then apply these techniques throughout your daily life, too, as CBT is also one of the ways to stop procrastinating How to Get Things Done and Stop Procrastination Do you often miss deadlines or work overtime? Are you procrastinating? Try these strategies and apps to change habits, get things done, and reduce stress. Read More .

Reduce Stress With Problem Solving

The word Problem being erased
Image Credit: fiftycents/DepositPhotos

There are generally two parts to programming; creativity and problem-solving. Whether it’s fixing a bug or problem in your code, or hunting it out in someone else’s, it is a skill to be able to deconstruct an issue logically. Problem-solving can be logical, but it’s also a creative process too.


However, it’s not always so easy to see things that way. Negative and overwhelming thoughts generally cloud our minds and affect our mood and well-being. Stress is a term that’s often used quite casually, but it can be incredibly devastating and distressing, leading to worsening mental health.

Programmers are adept at breaking down an issue into manageable chunks that can be gradually crossed off your to-do list. It’s a skill that can be applied throughout your life outside of work too. That’s not to say that being a programmer will stop you from ever feeling overwhelmed or stressed. You’ll be better equipped to manage it though, especially if you use these problem-solving diagrams How to Solve Problems & Get Ideas with These 5 Diagrams Drawing a digram is a powerful problem solving technique. The right diagram can reveal hidden relationships that lie hidden behind facts and figures. Try these five simple visualizations for everyday decision making. Read More too.

Develop Creative Skills

A light bulb on a table surrounded by colored paper
Image Credit: garloon/DepositPhotos

One alternative treatment for depression and other mood disorders is through art and creative therapies. These are typically arts-based activities with the support of a trained professional. They often take place in a group setting but can also be taken in one-to-one sessions. The aim of these therapies to give you space where you can express yourself, and that may give you an outlet for emotions or thoughts that are hard to put into words.


As with any treatment, the session you attend should be accredited and regulated. However, that doesn’t mean you can’t apply similar techniques on your own too. Programming offers an ideal space for using arts and creative therapy techniques. You use language, but an entirely different one, where it may be easier to express yourself. Words in our spoken languages often come with a complicated backstory.

Programming languages allow you to flex your creativity, problem-solve, and work towards a goal. This is especially true if you get into programming as a hobby, or have side projects. It means you have a safe space to create and try out new things, and is just one of the ways you can start living creatively You Can Start Living Creatively With These 5 Important Lessons We all have creative intelligence. Creativity can be polished with learning and practice. These five popular Udemy classes are the education you need to clear the doubts about your own promise. Read More .

Combined with CBT and stress reduction techniques, this space to explore your creativity will help you manage the often challenging emotions mental health issues can bring up.

Building Relationships to Overcome Loneliness

A person walking outside in fog
Image Credit: SimpleFoto/DepositPhotos


We said earlier that programming is a solitary task, and it often is. However, whether you work in an office or remotely, there is a large community of programmers out there. Sometimes the solution to a task will elude us; that’s when it’s time to reach out to other developers.

Stack Overflow is one of the most popular websites for developers for that reason. The forum has an incredibly active community that helps each other out. Post a question, and you’ll get a wide range of developers will different expertise chiming in. But the site isn’t only for work talk; it’s a hub for developers and programmers to chat too.

In fact, the Stack Overflow 2018 Survey found that 8.5 percent of users have a mood or emotional disorder, while 7.8 percent said they suffer from an anxiety disorder. That’s a significant proportion of the 1.3 million registered users. So, there are people who will understand and empathize with your own mental health struggles and be able to lend a sympathetic ear when you need it most.

We often think of programming as a purely digital activity, but there are many real-world programming communities too. Your workplace may have a professional network, or there might be a meet up in your local area. Being able to talk to people face-to-face helps some people reduce the isolation and loneliness associated with remote work and mental illness.

Support Your Mental Health With Programming

There’s a growing awareness that we should be looking after our mental health. And more people are opening up about their struggles than ever before. That doesn’t mean that your suffering isn’t incredibly personal, though, and you may not feel comfortable sharing how you feel with everyone.

You might be a pro at programming, or totally new to it. Either way, there are many ways programming can improve your mental well-being. Of course, you may also want to try these apps to manage your mental health 5 Free Positivity Apps to Manage Mental Health and Boost Your Spirits Everyday life can really wear you down. Try these helpful apps that can manage your mental health and boost your spirits. Read More too.

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Santiago
    November 6, 2019 at 5:02 pm

    One of the best and fun entry points to programming is video game programming. As for StackOverflow, it is known to be (sometimes) an unwelcoming site for newcomers, so it could be a double-edged sword for the topic on discussion, specially for those susceptible.

    • James Frew
      November 6, 2019 at 5:15 pm

      Yeah, unfortunately, as with many spaces on the internet, there will be people and conversations that aren't welcoming or understanding. However, on the whole, and especially if you delve into the more specific discussion areas rather than the open questions, it can be a supportive community.

  2. dragonmouth
    October 30, 2019 at 1:40 pm

    Psycho babble.
    From my experience of being a programmer/software designer for over 30 years, I can safely say that programming can create more mental problems than it can solve. Not everyone has the skills or the temperament to be a programmer and if you don't, it can be stressful and frustrating. It's like trying to fit a square peg in a round hole.

    • James Frew
      October 30, 2019 at 2:54 pm

      You're absolutely right that the most common experience is that programming, and the lifestyle around it, contributes to poor mental health. There's a lot of discussion about this online, but we thought it would be good to take an alternative look at how programming can positively affect your mental health.

      • Jon
        November 9, 2019 at 11:19 pm