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.
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) 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.
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!
Barbara Oakley, 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.
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.
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 by Headspace.
"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 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 🍬
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 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 and professes his absolute academic obsession with sleep and it's superpowers in his book, "Why We Sleep".
Got 19min and 18s to spare? Do yourself a favour and watch Dr. Walker's TED Talk.
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
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"
✅ Don't nap after 3pm. A nap is fine, just take it earlier than 3pm. Science says naps are good!
✅ 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!)
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!
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 for giving that all important advice on writing and setting up my first blog post 🙌
Here is a 'Why and How of Diffuse vs Focused' for software developers.
If you're interested in becoming mindful, check this out. The first 7 meditations are free and if you use this, 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.
What Happens to Your Brain When You Sleep or Don't
Apparently, men who only sleep five hours a night have markedly smaller testicles
than men who sleep more than seven.
Research shows that the world is exhausted and it's killing our economy.