I don't disagree, but when I've tried this I just find myself doubly exhausted: once (mentally) from the work, and again (physically) from the gym. Still agree that making time for the gym is really important though. But for me, it's not the answer to mental exhaustion but rather just part of a healthy lifestyle generally (personally, proper sleep hygiene is the only solution I've found to mental exhaustion and overwork).
When you walk into the gym you need to stop thinking about work and start focusing on your workout. For me, this comes in the form of planning which exercises I'll be doing, how much weight I lifted the previous time for how many reps, and how much I can increment it. And then during the lifts, I focus on the mind-muscle connection to make sure my form is correct and I'm activating the right muscles.
Trust me, when you do it like this, it's incredibly relaxing from a mental perspective. I actually look at my gym sessions as meditation time.
It took me a few years of consistent intense training to really get into the groove of things. I've been at it for about 9 years now. This is the intensity that I aim for (mind you, this is not me in the video): http://www.youtube.com/watch?v=LAhNyvTF5Uw
After that level of intensity on a consistent basis for a few years, you adapt to it. While you may feel tired, you gain energy from it as well.
Generally speaking, I think practicing martial arts is a good thing for technical people to do. It gets you out of your head and into a feeling space. And, there are many interesting parallels between the learning process in martial arts and in programming.
If anyone is interested, this book has given me a vastly different perspective on things like exercise (or in parent's case, martial arts): http://www.amazon.com/Mastery-Keys-Success-Long-Term-Fulfill... When put in that perspective, I think exercise would greatly appeal to most hackers.
Man I want to go ride now...
For myself, I've noticed that after getting healthier, just one cup of coffee a day keeps me plenty productive. I might have a cup of tea in the afternoon. But it's a far cry from my previous 3-cups-a-day habit.
What you are saying does not make any sense. If it did boost your body metabolism, then your enzymes should be working faster at breaking down alcohol.
Working out hard is additional stress. It boosts cortisol just like job stress. Stress depletes magnesium, and so does hard exercise. You will be hurting your health, not helping it, if you're stressed out and then do crossfit type stuff. That you can't train hard and endure other forms of stress is well known among athletes.
I exercise often and hard because I'm vain, but the health benefits of exercise are way oversold in my opinion. The pyramid of good health is 60% diet, 20% sleep quality and stress, 10% social and spiritual life, and then at most 10% exercise.
For me I'm really crap at switching off from work, and I can easily torture myself at the thought that I should be working. However when I drink, I pretty much say to myself - that's enough. And likewise if I'm on my bike.
So when I'm not drinking or not exercising, I'm not relaxing, and that's just a recipe for disaster for me - the knock on effect is that my programming really suffers. I find it a very difficult cycle to break away from, despite there being a simple solution.
At least you might be giving your brain time to breathe when you are exercising.