DEV Community

Cover image for Top 5 tips to be a better programmer without programming!
Luke Garrigan
Luke Garrigan

Posted on • Edited on

Top 5 tips to be a better programmer without programming!

Introduction

As an industry, I'd say we're all pretty clued up on how to be a better programmer:

  • Write code and write some more code
  • Read lots of code
  • Write your implementation, then rewrite it, then rewrite it again
  • Use meaningful names/structures
  • Refactor, refactor, refactor
  • Test, test, test

You get the idea.

In the majority of the Top 10 tips scattered around the internet for steps on how to be a better programmer, they lack what I consider the fundamentals. Now, these fundamentals don't just improve your programming ability they improve your health, wellbeing and just generally make you a better human.

This blog is sponsored by Code Canvases

Make your room come alive with the coolest programming/coding canvases on the market. codecanvases.com is the number 1 seller for programming prints with 100% exclusively designed canvases. Get them now whilst they're 20% off!!
[https://codecanvases.com/](https://codecanvases.com/)

1- Get your 8 hours!

Picture of a tweet saying
We've all seen the crazy routines of some top dog CEOs where they go to bed at midnight, wake up at 3am and read 2 books by 5am, these are absolute bullshit. And if you think can get by just fine with 5-6 hours sleep then you are wrong, In Why We Sleep by Matthew Walker (which you should read, bloody brilliant book) experiments shown that getting just 6 hours of sleep just one night can decrease cognitive performance by 20%.

And this fact, which I think is particularly worrying for us programmers:

subjects who got six hours of sleep a night for two weeks straight functioned as poorly as those who were forced to stay awake for two days straight.

I'll be honest, the above fact scared the living shit out of me. Whilst I was at University I would frequently get by on very little sleep. I supplemented my fatigue with a tonne of energy drinks and coffee, why sleep, when I could be studying? Only now do I realise how naive I was.

The best thing I ever did in terms of ensuring I was getting enough sleep was purchasing a smartwatch. I used to do the classic counting how many hours sleep I'll get if I go to bed now:

it's 11pm and I need to be up at 5am, that's 6 hours sleep.

In reality, it's probably about 4 hours max. A smartwatch is really good at telling you how long you were sleeping and how long you were awake in the night, I quite often have sleeps where I'm awake for over an hour in the night. allocatedSleepTime !== sleepTime

2- Step away from the computer

meme with a cats paw on the computer saying
Ever been stuck on a bug for a long period of time, scratching your head, questioning life, and then the moment you leave the room as you've had enough or it's hometime the solution suddenly comes to you in a stroke of subconscious genius? You're not alone, some of the greatest discoveries have been found when people weren't actively looking for them:

  • Newton discovered gravity under the comfort of his apple tree
  • Archimedes was having a bath when he came to understand that the volume of water displaced must be equal to the volume of the part of his body submerged.
  • James Wright in 1943 combined silicone oil and boric acid to find a cheap alternative to rubber for tank treads, he ended up creating Silly Putty.🀣 Okay, this one doesn't quite work, but you get the idea.

It's good to take a step away, occupy your mind with something else and go back to the problem with a fresh pair of eyes!

3- Get moving

Programming can be bloody stressful, you can spend all week working on a problem that you've estimated to be a one-line fix. You can have managers getting at you for taking too long to implement a feature or for introducing new bugs to the system. You might have 10x engineers in the office making you look bad, etc, etc.

Us programmers can be sat in our chairs for over 12 hours. Humans haven't gone through six million years of evolution for us to be hunched over our computers all day. There's plenty of scary articles explaining why sitting is bad for us.

Credit: Teepublic

One very effective way to combat stress is to exercise. Whether it be going to the gym, going for a run, going on a bike ride, a walk or playing a sport. Whatever it means to get your body moving do it!

Everyone knows the benefits of exercise but not everybody does it. Set yourself a goal, go X times per week, run X amount of miles.

I tend to go to the gym on workdays on my lunch break (Gym is next door to office), and go running every now and then, recently with the goal of running 20 miles a week (I'm pretty good at not doing the 20 miles🀣).

Running to me is like an active meditation, just getting outside with no route, no goal and getting lost is one of my favourite things to do. Humans were born to run (Another brilliant book).

4- Drink, drink drink. (Water that is)

We love our coffee, our energy drinks, our mountain dew but most of us just don't drink enough water. Being hydrated is so important for cognitive performance, overall brain function, energy levels, weightloss the list goes on and on.

It is recommended that you drink 2 liters of water a day (Half a gallon). I like to fill my liter bottle up in the morning and I know I have to finish it by midday and fill it up again and finish it by the time I leave work, most of the time filling it up a 3rd time to go to the gym at lunch.

Be water my friend

Being a programmer requires long sessions of intense concentration and yes, you can fuel this concentration by using caffeine, but it doesn't last for very long at all. Keeping your brain hydrated gives you a more sustainable focus than the 30-minute kick you get from downing a coffee.

So to become a better programmer, you better be necking some water.

5- Meditation

Our brains are going 100mph, continuously, like an endless washing machine of emotion, even more so for us programmers as 80% of our job is thinking; trying to create an elegant solution for a complex problem. Sometimes it is good to take a cognitive step away from it all. Meditation can reduce stress, reduce anxiety, improve attention span and even alter the structure of the brain; increasing the size of the hippocampus which is the part of the brain that controls memory (particularly long term) and regulates emotion.

dogo

This is one I'm not particularly good at but am in the process of learning. I often struggle to get to sleep as my brain is essentially overclocked, thinking of potential features I could add to my app, stuff I can write in my blog or ideas that'll make me a millionaire.

MY BRAIN JUST DOESN'T STOP.

10 minutes of meditation though, and I'm out like a light.

I use headspace which is an app that has a tonne of features to help you meditate. I particularly like the guided meditation as I often get lost in my thoughts and its good to have the gentle reminder every now and then to come back to the breath, plus I just love Andy Puddicombe's voice.

Taking time to do nothing is an investment we can all make, just 10 minutes a day. "Most people spend more time on their hair than they do on their mind" - Andy Puddicome.

And that's about it! I'd love to hear your thoughts and potentially ideas that I've missed for becoming a better programmer without touching your keyboard.

Top comments (15)

Collapse
 
osdave profile image
david parloir

This all so true! My advice is: adopt a dog. He'll force you to go outside, I can't count all the bugs I solved during the daily walk.
He stays under my desk during the day, warming up my feet and acting as a rubber duck when I'm stuck. At this point he recognizes the sound of the computer shutting down.
He'll be your best friend for all his life and asking nothing in return for his unconditional love.

Collapse
 
lukegarrigan profile image
Luke Garrigan • Edited

I couldn't agree with this anymore If I tried, dogs are just the best things on the planet. I work from home once a week and have my dog snoring next to me, I love it, also I take him to work every now and then which just makes everyone happy!

I love that he's also your rubber duck, I'm gonna have to try that, he'll probably just go back to sleep though πŸ˜„

Collapse
 
genta profile image
Fabio Russo

Agree! I've a dog too, and It's helping me in every aspect of my life, coding too.

Collapse
 
mt3o profile image
mt3o

Regarding 6h of sleep, does that research involved use of coffee? Because coffee (and nootropics) can reverse the effects of lack of sleep, and bring other costs, like anxiety and overall nervousness.

On my end I would like to add a tip to maintain mental health. If you think you are depressed, visit the doctor and have good meds and therapy. If you are ADD/ADHD, learn how to live with it and keep minimal dose of ritalin, works like a charm, don't overdo it.

Collapse
 
lukegarrigan profile image
Luke Garrigan

Yes there’s plenty about coffee and nootropics in why we sleep, it certainly doesn’t reverse the effects of lack of sleep, it may make you feel temporarily a little better but really you’re just trying to trick your brain, which isn’t good. That’s the attitude I had when I was at university, just dose myself with a tonne of caffeine to counteract it, but that’s a short term fix for a long term problem.

And yeah I completely agree with maintaining mental health, and the above tips if followed should help you towards that!

Collapse
 
mt3o profile image
mt3o

Yeah, caffeine is exactly tricking the nervous system by binding to the receptors instead of adenosine, and adenosine accumulates. Don't go there, you'll pay double. There is a substance which can reverse the need for sleep, but unless you are a military or narcoleptic, forget about it ;)
8h sleep and no more than 3 cups of coffee, no redbull, no mountain dew.
In my case, 3x coffee is a healthy maximum, 5 is exploiting me.

Collapse
 
paulasantamaria profile image
Paula SantamarΓ­a

So true! Finding that work/life balance is as important as any other skill. I can't count the number of bugs I've figured out while walking my dog, in the shower or simply after a good night's sleep.
Had the same experience with sleep too. I got a Fitbit a few months ago and was surprised to see that I usually spend at least 1 hour awake.
I'd also recommend trying to eat healthier. I found it easier to exercise and sleep better when I eat healthy. It all works together.
Do you recommend any resources about meditation for beginners? I'm trying to get into it, but don't know nothing about it tbh.

Collapse
 
lukegarrigan profile image
Luke Garrigan

Yeah completely agree about eating healthy, that’s definitely tip 6!

I started by using YouTube to try to understand what meditating actually was and followed along with some beginner guided meditations. Then I downloaded headspace, went through their free introduction and am trying to make it a habit!

Collapse
 
lukegarrigan profile image
Luke Garrigan

Haha thank you!

Collapse
 
rtosman profile image
rtosman

Great article, truthiness level is high.

Collapse
 
lukegarrigan profile image
Luke Garrigan

Thank you!

Collapse
 
mdhesari profile image
Mohammad Fazel

thank you!

Collapse
 
0xkoji profile image
0xkoji

so true and can not agreee more. but when i think of my life, i do completely opposite lol

Collapse
 
lukegarrigan profile image
Luke Garrigan

And so many of us do! πŸ˜„ try change one thing at a time and make it a habit.

Collapse
 
voidjuneau profile image
Juneau Lim

I’m disappointed. (1/2 kidding)
these looks even harder than coding. 😰