How do you manage programming burnout?

11 points by madhadron ↗ HN
I went to a colleague today and asked, pointing at my head, "What do you do when you've got the singed feeling?" He knew exactly what I meant, but neither of us had ever talked about it before. I don't know anyone who has written about it. Am I missing a whole field of reading material?

I do mean manage, not avoid. From years of programming, I know that I only have three to four hours of sustainable programming per day in me, but the last three days I chose to program nine hour days because. I was rebuilding a core data structure, and I knew that I would need an hour per session to get that piece of code into my head. Now I'm paying for it. Last night my dreams were bizarre, and today I may as well not bother coding at all. Tomorrow I might or might not, depending on how well I sleep.

So, in the interest of bringing this out of silence, how many hours a day can you program sustainably? How common are the folks who can program much more than three or four hours sustainably (from stories about Greenblatt among others, they seem to exist)? How do you manage your good hours?

10 comments

[ 4.7 ms ] story [ 35.2 ms ] thread
I like to think I can program more than 3-4 hours a day sustainably, I know I've had days where I worked for 8 hours (although its not always pure programming) and then came home and worked for hours more on personal projects, or also worked on the weekend on a personal project for many hours.

The thing is though that I have a habit of distracting myself fairly often by going on here to read articles, Reddit, etc, I'd say I normally wouldn't go more than half an hour without some forced distraction, often times even more often that that. I think doing something like this can help to keep you mentally fresh, at least it seems to work for me

Exercise! I work as a software engineer and spend my days coding. I also maintain a number of personal projects on the side which I try to work on daily. If I don't work out or do something physical that day, I get restless and eventually my productivity drops.
yes, this is definitely true
As important as it can be to keep the model of the system you are building in "ram", it is actually more important to allow your brain to digest and process new information with genuine downtime. The way I approach it is to "pulse" through the day with absolutely uninterrupted programming sessions of 1-2 hours interspersed with 20-30 minute breaks to allow time to digest. It is extremely important to maintain focus in the "on" times and not to feed new information into the wetware during the "off" times. For me, this required quitting reddit completely and limiting other news feed and communication quite drastically. The other key factor is to start your day producing instead of consuming (read about it here, as a matter of fact). Makes a surprising difference in your mindset.

The end result? I can sustain a solid hours 8+ hours a day of real engineering for 5-6 days a week without running too serious a risk of the burnout you describe whereas before I would be lucky to manage 3-4.

Start early morning and get to the hardest problems, I am usually best in the morning before lunch after lunch, my productivity is relatively down so I try to come in to office early when there are less distractions and leave in the evening on time so I can spend time on my hobbies/activities and not get burned out.
Productivity comes and goes in waves. Restful sleep increases the amount of time the wave is in and decreases the time the wave is out.

If you haven't slept soundly and regularly over a period of 5+ days I'd concentrate on that before worrying about anything else.

I came to this realization myself a few years ago and it was quite an epiphany. I realized that nearly all my bouts of nonproductive could be traced back to poor sleep habits.

I think sleep should be treated as methodically and rigorously as any form of exercise. When you sleep, how well you sleep, when you wake up, what you eat/drink before you sleep, etc, etc.

When I'm doing good on sleep I manage to program productively for around 6-10 hours a day and it's generally invigorating rather than draining.

I agree. It's night and day how you feel when you get a good 8 hours of sleep vs 6 or less. When you don't get that 8 hours, you blame it on other things but as soon as you repay that sleep debt, it's like an a-ha moment. Same with having the discipline to exercise first thing in the morning.
I remember when I first started to learn C in university - we had a (relatively) large project due and I had yet to start. I convinced myself to program for something like 30 hours straight.

It seems to be a bit of a badge to pull all nighters, but I can safely say that 80% of the time I spent in that stretch had no impact on my code at all. I would make stupid mistakes, and introduces more bugs trying to fix those mistakes.

There comes a time when you realize that a lack of sleep not only reduces productivity, it can actually hurt your existing code base.

You might be surprised at how much programming you can do in a day if you work on two or more different kinds of projects. Shifting gears can be difficult, but taking a break from one project to work on a side project can actually let you recharge a bit for the main project.

Mental fatigue is not just a function of effort. It's also a function of monotony.