Skip to content
Gun.io
March 14, 2024 · 5 min read

How to develop good mental health as a software developer

Being the CEO of your life is stressful.

There’s so much adult stuff you have to juggle. Family, friendships, health, finances…

The list goes on.

And these stresses don’t just magically disappear.

So, if you’re looking for advice on how to develop good mental health as a software developer, we’re here to help. This post has three suggestions to help you disarm your fears and be mentally strong.

Let’s go!

Suggestion #1: Build your “mental health stack”

Alex Lieberman coined the term “mental health stack”. 

It’s like a tech stack but for your mental fitness. 

“Managing your mental health is a full-time job […]

“There are things on my mental health stack that (bring down) my base level anxiety […] And there are things that help lower the fluctuations […]

“When I’ve not taken care of one of these things (sleep, exercise, diet) for more than three days, my baseline moves from a three or four to a six or seven […]

“I have a therapist, an executive coach […] and (I educate) myself […]”

— Alex Lieberman

Here are some things you can do to build your mental health stack as a software developer.

Simple works best:

  1. Getting 7-8 hours of sleep a night, and no screens at least one hour before going to bed
  2. Taking regular breaks from your computer to get some exercise
  3. Healthy eating habits
  4. Spending time in nature
  5. Journaling every day
  6. Reading before you go to bed
  7. Working with a therapist

Suggestion #2: Weekly “fear-setting”

Make no mistake. Being the CEO of your life is scary, particularly if you’re self-employed. 

Your worries can be a constant, low-level buzz—fears about your income drying up. About clients ghosting you. About having to pay taxes. 

Don’t get me started on AI!

A year of savings helped me when I went self-employed, but my mind still jumped to the worst. What if I can’t make payments? What if my income dries up?

What if, what if, what if…

To ease these worries, I do “fear-setting”. It’s a practice made famous by Tim Ferriss.

Once a week, I list ten of the worst things that could happen in my life. I then note ten ways I could prevent these things from happening. Finally, I list ten ways I could repair each bad thing.

The practice helps me realize how deceptive my fears can be. I face them head-on and see their point of view.
Here’s a free template in case you’re interested.

The image is taken from mindfulambition.net

Suggestion #3: Lex Fridman’s mantra routine

Lex is a humble guy who’s interviewed some of the world’s most successful businessmen, including Jeff Bezos and Elon Musk

In one of his videos, he shared a day in his life. What struck me about his mental health routine was his mantra.

It goes like this.

Part I: Rules

He says, “I remind myself of the constraints in which the game is to be played.”

Such rules include:

  • Getting 6–8 hours of sleep every night
  • Only checking social media when he posts (1–3 times a day)
  • Exercising every single day, even if he’s injured. “I find a body part that’s not injured and exercise that.”

Part II: Visualize

Next, he visualizes his day ahead — but quickly. “Like I’m in a game of Sims…”

He then says aloud three things he’s grateful for. He also meditates on the idea he might die.

“Today could be my last day on Earth.”

Part III: Goals

After visualizing, he says out loud his long-term goals. These are ambitious, five-year goals.

These are followed by his short-term goals. Lex defines them as things he can do by the end of the year.

Just out of reach but achievable.

Part IV: Principles

Finally, he lists his core principles. You can think of these as affirmations. These are things he strives to do.

He admits his principles are a little cliche.

They revolve around compassion, empathy, love, character, integrity, and strength — mental and physical.

Takeaways

The human brain is thousands of years old and wired to detect fear. Just the faintest whiff is enough to trigger alarms.

There’s no point in running. We might as well embrace it!

Here’s a summary of three suggestions on how to develop good mental health as a software developer:

#1: Build your “mental health stack” as a software developer — Check off your diet, exercise, and sleep. Consider other self-care practices, like meditation and therapy. It’s best to build the habits before you need them.

#2: Weekly “fear-setting”— Your fears may look absurd when you capture them on paper.

#3: Lex Fridman’s mantra routine — Positive self-talk can put you in an abundance mindset.

Feel like you’re on your way to developing positive mental health as a software developer? Let’s channel that into something productive! 

Here at Gun, we help software developers work with amazing clients. So get in touch with us today and see how we can pair you with some of the best minds in business!