Burnout is always a tough thing to deal with, and I've definitely suffered from it in the past. By no means have I solved the issue for myself - I'm still constantly trying new ways to prevent it - but one that has certainly helped is having a variety of things to do.

As a programmer, this mostly involves switching between languages, languages that differ quite a bit. I'll go anywhere from a few hours to a few weeks working on one language, say, PHP, then if I get tired of that, I have plenty of options. With the current project I'm working on, I've been switching from PHP to node.js to frontend javascript (coffeescript to be more specific) to CSS. All are very different in how they are programmed, making each new switch something that helps prevent complete burnout for me. One day I can work on some hard-core backend, getting all the backbone structure in place, and the next I can get more arsty and play around with some HTML and CSS. It's good to have options. Of course, some days you're going to be forced to work with one specific area of programming, but having rotated through them throughout the process, you'll likely not be as tired of it.

If you're someone who specializes in one programming language and have issues with burnout, I suggest trying to pickup something new. That doesn't mean learn Java if you're a C++ programmer - both are backend - try something on the opposite end of the spectrum like some HTML and CSS. If you're strictly a frontend developer, try familiarizing yourself with Bash-Scripting to make tools that will speed up your development process.

It's not just varying programming languages that helps; some days I'll just sit back and read/learn about technical stuff (whether it be programming languages, unix, databases, etc) which I still find productive. Others I will focus more on the entrepreneurial side of things and work on planning out the company's future, taking in advice, or reaching out to others. Lately I've spent a good chunk of time reading questions and answers from successful entrepreneurs on Quora. One more option of productivity that I've been using lately, is writing my thoughts on this blog, which I enjoy.

I know many of my readers aren't programmers, but I'd argue this applies to everything in life that one can be burnt out on. A little bit of variance and changing things up can go a long way. For example, my girlfriend and I were having salmon and shrimp 4 or 5 days a week when we started the Paleo diet. The result of this was after a few weeks we started to despise fish and subsequently haven't had it in over a month. Had we just been eaten it once or twice a week, I'm sure that would still be a meal in our repertoire. Routines can be good, but with certain things routines need to be switched up every so often to stay fresh and prevent burnout.