The 3 Best Wellbeing Habits You Need to be a Better Developer
Tags: mentalhealth, habits, codenewbie
Published: 2020-06-30 09:45:15

## Our Mental Health and Wellbeing Needs Help

Like you, I'm someone who makes stuff for the web.

Like you, that means I sit in front of my monitor from 9-5 (sometimes later, especially when there's _just one more bug to kill!_).

**Newsflash: this behaviour isn't the best for our postures or mental health**

So shortly after noticing the effects of my habits as a developer, I started searching for habits that would help _counteract_ this practice of being in front of the screen for hours on end.

## But First, Why Listen to Me?

I have a degree in Human Physiology, Genetics, and Psychology so I sort of know how our bodies and brains work in creating a complex, highly-functional organism capable of critiquing tech tweets...

Ha! I don't remember a damn thing from that degree so ignore my 'credentials' because I don't have any. The only way you can trust me is check this 👇 and nod if you get me:

❌ aching eyeballs
❌ sore back
❌ grumpy about bugs
❌ headache at lunchtime
❌ writer's block (but with code)
❌ the eternal suffering of life as a developer (Jk, I love this stuff but sometimes it's hard).

> Now, what if I told you I had the cure to at least 87.5% [(quick maths)](https://www.youtube.com/watch?v=3M_5oYU-IsU) of these problems?

Read on because what I propose will make you a happier, healthier developer who gets your Starbucks with your name spelt _right_ (imagine that...), an abundance of ice cream, world fame... You get the point.

## Why Happier and Healthier developer?

So if you _didn't_ get the point, here it is:

Being a happier, healthier developer will have tremendous knock-on effects for the rest of your life:

🚀 You will become a more understanding and respected member of a team
🚀 You will solve coding problems faster
🚀 You will have more creative ideas meaning cooler side projects... and better tweets! 😉

Alright! If you've made it this far, I applaud your patience aaaand LET'S GET TO IT!

## Firstly, Focus on the Process

[Barbara Oakley](https://barbaraoakley.com), known for her course "Learning How to Learn", explains this quite succinctly:

> "Focus on the process (the way you spend your time) instead of the product (what you want to accomplish)."

Now, if you apply this to the way you approach a day of coding, you may find a significant reduction in frustration.

But _how?_

Well, it can be quite simple...

**Adjust Your Mindset**

Instead of thinking "My day will be successful if I fix this failing code", approach it slightly differently.

Maybe something like "My day will be successful if I _spend time attempting_ to fix this failing code".

That slight mental adjustment is especially helpful for beginners - often they (a.k.a. _we_) underestimate a problem and feel that they've wasted the day when they go to bed without having solved it.

Your feelings of frustration only hurt yourself, they don't help you to code better or faster.

So try it - **focus on the _process_ because, guess what, tomorrow is another day.**

## Secondly, Attain a State of Mindfulness

Not to get all 'new-agey' and stuff but this is a serious contender for one of the best things I've started doing in the last year.

If you're not sure what this is about, check out [this explanation](https://www.headspace.com/mindfulness) by _Headspace._

If you want to get some practical ['how-to'](https://samharris.org/how-to-meditate/), you'd do well to see what [Sam Harris](https://samharris.org/) has to say.

> "In a nutshell, mindfulness is the quality of being present and fully engaged with whatever we’re doing at the moment" - Headspace

So now that we know what is, how can we apply it to our lives as professional debuggers?

Imagine for a second that you are fully engaged with a block of code in front of you. "Yeah, dude, that's called concentration. I do it every day!", I hear you say. True! But...

What if I told you that being fully engaged also meant knowing when you're _not_ thinking _optimally_? Or that being fully engaged (re: mindful) allows you to quickly realize that it's time to get up and take a break for your own good?

**Don't Bash the Wall with Your Head**

You see, so often we get stuck into our work and plough on, come rain or shine in the proverbial landscape of our minds, that we don't see it's major downsides. Bashing your head against the wall is not a good way to break the wall down!

What I'm suggesting is that mindfulness at your work station will help to quickly realize when it's time to take a [diffuse thinking approach](https://www.coursera.org/lecture/learning-how-to-learn/introduction-to-the-focused-and-diffuse-modes-75EsZ) as opposed to a persistent focused one. And research shows that these two approaches work in tandem to create solutions to difficult problems.

I've added a little treat at the end of this post for those interested in becoming mindful 🍬

## Lastly, Sleep More Than You Think

**Lol. Obviously. Nothing new... Right?**

Apart from the obvious advice of "Exercise every day and eat well", sleep is absolutely essential for a healthy developer mind. And if you're sleeping less than 8 hours a night, you might be in trouble like most of the developed world.

> It has been argued that the physical and mental damage from one bad night of sleep is [far greater](https://news.berkeley.edu/2017/10/17/whywesleep/) than eating terribly or not exercising.

There are a HUGE number of awesome health benefits that sleep has which you can see at the end of this post but here's a little example of what happens in your brain when you sleep:

- Your glymphatic system is boosted allowing it to **clear your brain of toxic waste**. By sleeping, you're basically allowing your brain to take a nice hot shower to wash off all the day's rubbish. How convenient!
- Your brain moves short-term **memories into long-term storage**. Getting a good night's sleep after learning something new is like hitting a healthy 'Save' button on all that new info.

**Practice, Sleep, Repeat**

How many times have you heard, "The only way to become a better coder is to practice practice practice"? Well if you've been on tech Twitter for even a minute then you know it's a favourite quote of the "influencers". And for good reason right? We need to train our minds with the ways of code and that takes time and physical typing practice.

But there is a crucial thing that needs to happen after your practice for the day...

> “Practice does not make perfect. It is practice, followed by a night of sleep, that leads to perfection.” - Matthew Walker

**Ok. Cool. The dude has quotes but who is this Mat guy?**

Let me just say that you'd do well to follow his advice to the letter. He's a neuroscientist at Berkeley (formerly at Harvard) and he's one of the top people in the WORLD when it comes to sleep. He's only been studying it for like _20 years_. No seriously, this guy know what he's talking about. He's worked as a sleep consultant (yip, that's a real thing!) for the [NBA, NFL, and British Premier League football teams](https://books.google.com/books?id=ZlU3DwAAQBAJ&pg=PA10&lpg=PA10&dq=matthew+walker+sleep+consultant+premier+league&source=bl&ots=MVT8bEWVnW&sig=ACfU3U3GdyiKxs0saJiQpgOOeKqrb6_3AQ&hl=en&sa=X&redir_esc=y#v=onepage&q=matthew%20walker%20sleep%20consultant%20premier%20league&f=false) and professes his absolute academic obsession with sleep and it's superpowers in his book, ["Why We Sleep"](https://www.audible.com/pd/Why-We-Sleep-Audiobook/B0752ZQR33?source_code=ROWGB13108101800N6&gclid=CjwKCAjw5vz2BRAtEiwAbcVIL99i36Bk3aewC9klaA_AesHEptLK6I8I1aA7ZsACJKws3OBS-TAa0hoCyCUQAvD_BwE).

> Got 19min and 18s to spare? Do yourself a favour and watch [Dr. Walker's TED Talk](https://www.youtube.com/watch?v=5MuIMqhT8DM).

In short, his talk could be renamed "Sleep or Die". Fun.

**Sweet. He's the real deal. So what should I do? What's his advice, yo?**

The TL;DR would be:

Sleep at least 8 hours

per night,

_every night._

Here are some more **actionable tips** from his book to ensure you give your brain the rest it deserves:

✅ Don't exercise two or three hours before your bedtime.
✅ Stick to a sleep schedule, even on weekends!
✅ Avoid caffeine (_cringe..._) and nicotine. If you must have coffee, like me, stop drinking it before late afternoon as it takes up to 8 hours for caffeine to wear off.
✅ Avoid alcohol before bed - it robs your brain of REM sleep which acts as ["overnight therapy"](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2890316/)
✅ Don't nap after 3pm. A nap is fine, just take it earlier than 3pm. [Science says naps are good!](https://www.newscientist.com/article/mg23030750-800-how-can-i-nap-like-a-pro/)
✅ Blue light delays our sleep-onset hormones, avoid it as early as possible in the evenings.

**My fellow humans, just do yourself the biggest favour and sleep lots.**

(There is another nugget of sleep info straight from the man himself at the end of this post and a fun fact about men and their _shrinking testicles_!)

## Conclusion

That's it! You now know the things I try to focus on in my quest to be a better developer (and human in general, tbh) in this long-term thing we call life.

If you've enjoyed the read, learned something new, or know a friend or family member who could benefit from reading it, please share it! The things we've spoken about in this post have shaped my approach to life quite dramatically. **Maybe someone needs to hear this stuff too**.

Finally, thanks for reading!

Do you have some advice on how to be a better developer? I'd love to hear from you! Find me on [twitter](https://www.twitter.com/ReyTheDev) or pop me an email at reyvdb@gmail.com.

Oh, remember to check out the Meditation Links #2 below for the little treat I promised!✌💚

_P.S A huge thank you and shout out to [Monica Lent](https://twitter.com/monicalent) for giving that all important advice on writing and setting up my first blog post 🙌_

---

### Extra Links You Might Find Interesting

#### Process vs Product Links

Here is a ['Why and How of Diffuse vs Focused'](https://www.7pace.com/blog/focused-vs-diffuse-thinking) for software developers.

#### Meditation Links

If you're interested in becoming mindful, [check this out](https://wakingup.com/). The first 7 meditations are free and if you use [this](https://share.wakingup.com/dab9b5), you'll get a FREE MONTH from me - no card, no strings attached, simply a month free. At the end of your free month, it's possible to ask the Waking Up team for a free subscription if you can't afford it. They're super understanding and will help you out no questions asked.

Need more convincing that mindfulness is good and works? Check out [this article](https://greatergood.berkeley.edu/article/item/the_state_of_mindfulness_science) from UC [Berkeley](http://berkley.edu) about the scientifically-backed benefits of mindfulness.

#### Sleep Links

["How to Improve your Sleep" - Matthew Walker](https://www.youtube.com/watch?v=lRp5AC9W_F8)

What [Happens to Your Brain](https://www.foundmyfitness.com/episodes/matthew-walker) When You Sleep or Don't

Apparently, men who only sleep five hours a night have markedly [smaller testicles](https://www.wired.com/story/youre-not-getting-enough-sleep-and-its-killing-you/)
than men who sleep more than seven.

Research shows that the world is exhausted and it's [killing our economy](https://www.rand.org/randeurope/research/projects/the-value-of-the-sleep-economy.html).