Settings

Theme

Best ways to fight fatigue when coding?

13 points by bpg_92 10 years ago · 19 comments · 1 min read


Just wondering if you have tips, somethings I just want to give up coding, I don't know, it is just one of those moments, really stressed out.

sudojudo 10 years ago

First, don't set deadlines that make things difficult. Give yourself time to do the job properly. If the client is too demanding, they're going to be a problem in other aspects of the job as well. Gaining respect first comes from respecting yourself.

Second, get plenty of quality sleep, that means no caffeine/alcohol for 6-8 hours before bed, and allowing yourself at least 8 hours of uninterrupted sleep.

Third, when working, get up and walk around once an hour, for at least five minutes. Have a healthy snack, do some push-ups, walk around the block, anything but sit.

Fourth, exercise! Do something that makes you sweat for at least 30 minutes a day. This one is a must, no excuses.

Fifth, stretch. This can be done during your five minute breaks. If you do nothing else in this list, do wrist flexor and extensor stretches (look them up). Otherwise, your coding career can get cut short (speaking from personal experience). Stretching takes 2-3 minutes and can make a world of difference; do them every time you're feeling stale. It's not possible to stretch too often.

Next, eat right. Keep your diet light, skip the soda and chips; eat fruits, nuts and veggies, drink water. You're already sitting on your ass all day, don't make it worse by fueling yourself with garbage.

Finally, have some hobbies that don't require a screen. Go hiking or biking. Play a sport. Learn an instrument. Bird watch. Build a tree-house. Catalog all of the different bugs in your yard. Whatever, just get away from screens.

All of this is obvious and a no-brainer, right? Well, look at the people who have been in a field for 20-30 years, the ones who stick to the above are easy to spot; they're the fit, happy, healthy people. The others are easy to spot too, because they look like hell. Get into these habits before you need to, you'll be saving your future-self a lot of trouble.

Hope that helps. Time for my workout...

  • bpg_92OP 10 years ago

    Thank you so much, you are right, I'll just drop some projects and try to focus on myself, I am in the border of a collapse if I keep going this way.

shanehoban 10 years ago

In my opinion, you only have about 4 hours maximum of quality coding in you a day - I want to stress the quality part of that.

You can code 12 hours a day, but compare the code in your first 4 hours to your last 4 and see what I mean.

Just stop coding. Do other stuff.

I find that I can extend that quality window by spreading it out more. Don't do 4 hours in a block. Do an hour, or 1.5 hours and break for 30mins. Clear the head again. Then go back, you can do this more - leading to > 4 hours of quality code

joelg 10 years ago

I've been experimenting with working away from an Internet connection, and it's been working really well for most things. It has two great features:

- it forces me to focus only on code when I'm coding, since 9gag/Reddit/Facebook aren't available, and

- it forces me to get up and walk around and do physical things when I'm taking a break from coding

I find I am less fatigued and about as efficient, even if it means building a queue of Googleable bugs/questions that I return to when I'm back on the internet.

altotrees 10 years ago

The one thing to avoid is too much caffeine, or any other stimulant. First thing in the morning, I have found that they make me feel like the most brilliant, innovative writer and developer ever. So I have some more, and a bit more, and a touch more...

Later on in the day, I cannot even understand some of my earlier thoughts, I get shaky and generally burnt out. Watch out for too much of a good thing.

I have also found that sleep, a brisk walk in the afternoons, and exercise after work help tremendously. Taking care of yourself will improve your work life greatly. Sure, you can grow more proficient and versatile sometimes by locking yourself in a room in front of a screen coding, but do it too much and the impact will be more negative than positive. YMMV.

tmaly 10 years ago

Take a break, read something not about coding. Go for a long walk or hike. Clear your head.

ruraljuror 10 years ago

Barbara Oakley has some great material on focused vs diffuse thinking. If you are struggling and frustrated with something it is probably the right time to walk away and give it a break. You can solve problems in your sleep.

rolfeb 10 years ago

Back when I used to work a second job in the evenings, I used to get home around 4-5pm in the afternoon and have a nap. No more than 20 mins (set the alarm clock!). Made a huge difference.

hden 10 years ago

Try coding on a hammock.

Hammock Driven Development https://www.youtube.com/watch?v=f84n5oFoZBc

bbcbasic 10 years ago

For me

1. I saw a specialist doctor because I was fatigued coding or not coding. Turned out I needed some treatment.

2. In addition I quit my job in a stressful environment where I was pressured to get complicated work done quickly, with little or no help, working with people who were either arrogant or just too busy themselves.

Now I work 38 hrs a week and I am happy. I have energy to learn in my spare time, and I am just learning stuff I find interesting not to 'enhance my career'. Also have a family and sleepless nights due to having young children, but that is manageable if the work environment is good.

  • arithma 10 years ago

    Would you mind elaborating a bit more about the treatment/diagnosis. I believe I am facing something similar, been having swings positive and negative, but it has been become mostly negative now.

    • bbcbasic 10 years ago

      I didn't feel depressed with highs/low, it was more like a foggy mind, wanting to sleep. Not like when you only get 2 hours sleep. Different feeling to that. Imagine getting 2 hours sleep without the adrenaline kicking in to compensate.

      I was found to have low testosterone, adrenal fatigue and the Lymes disease bacteria showed up although the accuracy of testing for that is not perfect. Treatment based on rectifying those things - testosterone supplements, other supplements for adrenal, strong antibiotics for 6 months.

      Hope you are able to sort your symptoms out. For hard to diagnose things you have to treat doctors like staff, i.e. know about the problem enough yourself so you can judge if the doctor is doing is a good job. It's a hassle and last thing you need when you are sick! Luckily I wasn't too sick but feel sorry for people who get fatigue really bad where they can't leave the house for days.

angersock 10 years ago

If you feel like taking a break, just take a break. :)

When you feel better, come back to it--you aren't any worse for doing so!

  • bpg_92OP 10 years ago

    But the deadlines! I am sleeping so little, got too much caffeine in my system, dunno, thanks for the advice though, will try to take a nap and see some posts in 9gag

    • afarrell 10 years ago

      Block 9gag with /etc/hosts or https://getcoldturkey.com/ or https://selfcontrolapp.com/ and spend the entire time on sleep.

      If you aren't getting enough sleep, that is the reason you're fatigued. Prioritize fixing your sleep over everything else because without a well-rested brain, it is impossible to consistently write good software. Without writing good software, you can't hit your deadlines.

      Seriously, your brain is a part of your body. Take care of both of them. This isn't just some feel-good advice. Taking care of yourself is actually necessary for solving difficult problems.

      Also, make sure you understand the abstractions you are working with. Not doing so means you go around in circles. Make sure you have a clear "Definition of Done" for what you are building. Not doing so means you're going to go back-and-forth with your client/employer/TA and waste a lot of effort. Make sure you write automated tests as you write your code. Not doing so means that when you write a bug you could spend hours trying to chase it down.

      Don't treat necessities as if they were luxuries.

    • AnimalMuppet 10 years ago

      Coding is not an assembly line. If you're too tired when you do it, you move more slowly, and you make more mistakes. You then have to find and fix the mistakes, which is even harder when you're tired.

      Extreme Programming (XP) is about going absolutely as fast as you can. Two of XP's maxims are "Quit when you're tired" and "Never work overtime for more than one week in a row" - because you go faster when you quit when you're tired and don't work tons of overtime.

      • afarrell 10 years ago

        If coding was an assembly line, you wouldn't want to do it while tired. That would be a good way to get <insert unpleasant description of industrial accident>.

        Sleep is super necessary.

    • angersock 10 years ago

      Deadlines are no big deal. The world won't stop if you miss some by a day or two, especially if you're already a wreck and not sleeping.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection