https://puppycoding.com/2023/07/22/healthy-coding-habits/ * Home * About * Contact --------------------------------------------------------------------- PuppyCoding Friendly Python & AI tutorials for beginner & intermediate programmers. --------------------------------------------------------------------- July 22, 2023 The Most Important Coding Habits Two friendly old monsters with walking sticks. I've just learnt the hard way that the most important coding habits are not readability, consistency, organisation or any of the things that make our code better. No, the most important habits are those that enable us to enjoy this craft for years and decades to come. I'm writing this lying down, recovering from a slipped disc (spinal disc herniation) that's a result of far too long hunched over a keyboard. I've tried to take steps to improve my posture over the last few years but alas, I let good habits slip and I've been taught a lesson. MRI scan of the spine showing a spinal disc hernia, bulging out and pushing against the spinal nerve. A slipped disc doesn't actually mean a spinal disc has been dislodged. It's actually when a disc, usually near the base of the spine, develops a bulge which sticks out and presses against the spinal nerve. It's as painful as it sounds (and then some!), and also causes tingling and pain in the legs too. At times it's made me unable to move and unable to sleep. Recovery takes weeks or months, although surgery is also an option. It could happen to any of us if we develop unhealthy habits when programming, with the strain on our backs building up over time. And so, fellow keyboard warrior, here are some steps I encourage you to take to avoid this pain. Daily stretches According to my osteopath*, sitting for long periods of time had led to my stomach and thigh muscles being relatively unused, and therefore unable to assist my back in supporting my body, putting it under extra strain. Although strength-building exercises would be best, just doing daily central and lower body stretches would have a positive effect. The muscles would be more supple and more able to help support the body. Photo of a man outside on a terrace, stretching forward in a yoga pose. You don't have to suddenly become a yoga fanatic (although you can if you want!). Just regular stretches in the morning or after a hot bath in the evening, when the body is relaxed, should make a big difference. Take regular breaks This is so simple but so important - at least once an hour get up and take a short walk or some other non-screen activity. Not only is this an easy way to look after your body, I've often found that it helps with coding too. So many times I've been stuck on a problem, done something completely different, and then come back to the problem with an idea of something new to try. I feel like this is something we all know we should do, but often hard to put into practice. Time to make it a habit! Don't code late at night I think we're all guilty of this, sometimes even turning it into a boast - "I pulled an all-nighter!" Surely it's time we change this attitude. Our code is worse, even harmful, when we're really tired, and we naturally concentrate less on our posture leading to being hunched over the keyboard for hours. Please set a time past which you will switch off, mentally and physically, and be strict with it. Improve your coding environment I have a laptop stand and ergonomic chair, both of which make sitting at my desk much more comfortable, but even with those I still ending up suffering with back pain. I've heard so many recommendations for a standing desk that at last, I'm making the switch. Currently I just have a temporary setup of a small table on top of my desk, but already I can feel I move around more than when I sit, without really feeling more tired. It also naturally leads to taking more breaks so it's a 2-in-1 habit! I don't know why it took me so long to realise the importance of this and all the other habits, and I wish I'd fixed my ways earlier. Now I've paid the price but hopefully it's not too late for you, especially if you're in the early stages of your career. Please learn from my mistakes and enjoy many happy years of healthy coding! --------------------------------------------------------------------- * I previously wrote "chiropractor" here but have changed it to "osteopath". I live in Japan so I didn't know the English name but the place I go to is a Jie Gu Yuan , which I think is probably an osteopath but I'm not 100% sure. Share this: * Twitter * Facebook * Like this: Like Loading... General advice, health, programming, tips --------------------------------------------------------------------- [7fdc1] Posted by: daniemon --------------------------------------------------------------------- << Previous Post Leave a Reply Cancel reply Enter your comment here... [ ] Fill in your details below or click an icon to log in: * * * Gravatar Email (required) (Address never made public) [ ] Name (required) [ ] Website [ ] WordPress.com Logo You are commenting using your WordPress.com account. ( Log Out / Change ) Facebook photo You are commenting using your Facebook account. ( Log Out / Change ) Cancel Connecting to %s [ ] Notify me of new comments via email. [ ] Notify me of new posts via email. [Post Comment] [ ] [ ] [ ] [ ] [ ] [ ] [ ] D[ ] Search [ ]Search Recent Posts * The Most Important Coding Habits * How to print ChatGPT API response as a stream * How to Get a JSON Object From ChatGPT Using Function Calling * How to Hide API Keys When Deploying Code * The Simplest Way to Use ChatGPT with Python advice AI API books ChatGPT deploy example free GitHub health Heroku howto JSON OpenAI programming Python safety server tips Newsletter Type your email... [ ] subscribe * Tumblr * YouTube --------------------------------------------------------------------- Recent Posts * The Most Important Coding Habits * How to print ChatGPT API response as a stream * How to Get a JSON Object From ChatGPT Using Function Calling Follow Me Twitter YouTube Newsletter Type your email... [ ] subscribe (c) PuppyCoding 2023, All Rights Reserved. Blog at WordPress.com. Loading Comments... Write a Comment... [ ] Email (Required) [ ] Name (Required) [ ] Website [ ] [Post Comment] * Follow Following + [croppe] PuppyCoding [ ] Sign me up + Already have a WordPress.com account? Log in now. * + [croppe] PuppyCoding + Edit Site + Follow Following + Sign up + Log in + Copy shortlink + Report this content + View post in Reader + Manage subscriptions + Collapse this bar %d bloggers like this: [b]