Introduction
For a long time coding meant sitting all day and barely moving at all. This kind of sedentary lifestyle is proven to be terrible for both physical and mental health. Here’s how and what I changed to become a healthier and better programmer.
Why sitting too much is a problem
Developers easily spend 8–10 hours a day sitting. Researches shows this level of inactivity raises the risk of cardiovascular and other health issues. You don’t need to become a marathon runner, but even reducing the sitting time makes a big difference.
Moving more
Training was the turning point for me.
- Steps and walking: Hitting >5k steps a day is a good starting point to aim at. I often use an indoor bike in the evenings, it’s an easy way to add movement without leaving home.
- Zone 2 cardio: I dedicate 3–4 hours a week to running or cycling in Zone 2. It’s great to reinforce cardiovascular health and to feel better mentally.
- Weight training: I lift three times a week on a fullbody split. My goal is hypertrophy, but even 2 sessions a week, with 1 set per muscle group is enough to gain strength and muscle mass, which helps with endless things like injury prevention, posture and of course self confidence.
Science backs this up, just a few well structured sessions each week are enough toimprove both body and brain performance.
Fixing my sleep
Sleep is the real foundation of mental health and recovery. I improved a lot by:
- sticking to consistent bed and wake times when possible
- cutting caffeine after lunch (even if you don’t feel it, it badly affects sleep quality)
- trying to get 7-8 hours of sleep per night
Avoiding screens before bed also helps, but personally I find it almost impossible. I try to mitigate the damage by using night mode on my smartphone and computer.
The result: fewer awakenings, deeper rest, and waking up super refreshed. It’s a very underrated productivity hack.
Coffee: Useful but dangerous if misused
I use coffee as a tool. One/two cups in the morning, for pre-workout or during work, that’s it. Drinking it in the afternoon is not worth the sleep disruption. When I need the ritual I’ll have a decaf or zero caffeine drinks (coca cola zero has a small amount of caffeine, be aware of that, especially late in the day).
Tracking is fun and motivating
I use a smartwatch to keep track of steps, heart rate, and sleep. You don’t need the most expensive Garmin, trends matter more than absolute numbers. Seeing progress over weeks and months is very motivating.
Nutrition
I am the kind of person who can’t stop eating if there’s food around, and working from home makes it a real problem. I was over weight for basically all my life, and I never managed to fix it until I understood how nutrition really works. I solved it by structuring my nutrition around a few simple principles:
- the right amount of protein (around 2 g/kg of body weight)
- high carbs to fuel brain function and training
- moderate fats, mostly from healthy sources
- plenty of vegetables and fruits for micronutrients
Eat in a calorie deficit to lose fat if needed, otherwise stay around maintenance. I lost fat and built muscle, it’s been a game changer for my energy and confidence. Now I tend to track everything at the gram level, but that’s not necessary for everyone. I highly recommend the app MacroFactor, it’s the best one for me (I literally tried them all). I even built a simple calorie tracker app, you can find it on my GitHub, but that’s for another post, and paid alternatives are 100x better.
The diet world is full of misinformation, keep it simple. You will feel better and work better.
Where to start
- Walk more, even if it’s just standing up and walking around for a few minutes every hour.
- Lift weights twice a week.
- Add 2–3 hours of light cardio weekly.
- Track and prioritize sleep.
- Track your progress with a simple app and/or wearable.