
Best ways to fight fatigue when coding? - bpg_92
Just wondering if you have tips, somethings I just want to give up coding, I don&#x27;t know, it is just one of those moments, really stressed out.
======
sudojudo
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_92
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
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
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.

~~~
afarrell
For osx, [https://selfcontrolapp.com](https://selfcontrolapp.com) is also
useful for blocking 9gag/Reddit/Facebook, but it will still let you get on
stackoverflow

I think for windows there is
[https://getcoldturkey.com/](https://getcoldturkey.com/)

------
altotrees
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
Take a break, read something not about coding. Go for a long walk or hike.
Clear your head.

------
ruraljuror
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
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
Try coding on a hammock.

Hammock Driven Development
[https://www.youtube.com/watch?v=f84n5oFoZBc](https://www.youtube.com/watch?v=f84n5oFoZBc)

------
bbcbasic
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
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
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
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_92
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

~~~
AnimalMuppet
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
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.

