I'm a programmer and an athlete as well, and I find that I absolutely cannot code after coming home from the gym, I'm too exhausted to get in a groove.
(My workouts these days are weightlifting ones as well, so it's not that I'm not doing comparable workouts.)
Just want to throw that out there. I still recommend going to the gym, and love it.
I'm also very motivated after a gym session. I get up around 830am, eat breakfast, work until about 2pm...then I hit the gym until about 4 with some cardio and lifting..and then I shower, eat dinner, and get back to work.
Are you doing actual weightlifting (mostly near maximum strength) or bodybuilding? Doing 3x10 sets I can easily exhaust myself to a point where I'm mentally unable to do anything serious afterwards and need days to recover. After weightlifting (powerlifting/olympic), I usually have a lot of mental clarity and recover more quickly. Also: are you taking long enough breaks between sets?
I'm happy to hear you're doing everything right (but the part of me that was hoping for something easy to fix that could help you enjoy lifting more is a bit sad...). Using a watch for timing breaks is something I'll pick up, thanks for mentioning it.
Obviously don't know much about your situation, but this might have a lot to do with your diet & pre/post/peri workout nutrition. You should never feel exhausted and drained after a workout, but should feel invigorated and alert. Maybe something worth investigating more.
This is, of course, not true. Nothing is every universally applicable.
Go to the gym and do a heavy squat or deadlift day and I assure you that you'll feel pretty tired for a bit after the session. This is basic science. You can mitigate this by nutrition post workout, but even so, there will be a lag in time when you could feel drained.
As fingerprinter pointed out this isn't universally true, however research (and my own experience) has shown that the main reason people don't feel well after working out is almost entirely due to nutrient depletion and poor nutritional timing. If you go to the gym and do heavy squats at 6:30pm without eating anything since your lunch at 11:00am you are going to feel like absolute shit afterwards. Post-workout nutrition is essential for building muscle and recovery, but making sure to eat a mix of complex carbs, protein, and fat ~1 hour before you workout makes a world of difference for how you before during, and feel after your workouts. If your diet is sound though, and working out still makes you feel so terrible that you don't wish to do it (I'm not talking muscle soreness or the usual reasons people find to not workout) you should definitely consult with a nutritionist or dietitian as something else may be going on.
I believe that I do maintain a proper diet for my weight-lifting, I eat well during the day before my workout and afterwards as well.
I feel fine after my workouts, I just don't feel so great that I can get into the state of focus I need for programming. So it's not fair to say that I don't feel well; just that it usually requires more focus to program than I can muster after a workout.
>>If you go to the gym and do heavy squats at 6:30pm without eating anything since your lunch at 11:00am you are going to feel like absolute shit afterwards.
This is correct.
Eat a wholesome meal(but don't overeat) 90-120 minutes before you leave for the gym.
Those squat numbers aren't going to go up on their own. :)
It's necessary to maximise the weight lifted. Some force is transmitted through the trunk as opposed to through the spine and back muscles. The organs are broadly speaking incompressible, but the lungs are not.
Squeezing the abs pushes the organs up and holds them in place, compressing the air in the lungs, creating a more rigid trunk. This stops lifters from having their chest drop down, which will cause a dropped lift or even an injury.
Of course, if you squeeze the gut, the stomach can decide it's time to vomit if you have a lot of food in it. So ... don't do that.
Similarly if you're having lower intestinal disquiet.
Keeping a strong core (which, at first, requires a mental focus on tightening your abs at certain points before it's built into muscle memory) is necessary for good form with a variety of the olympic lifts.
Having stronger abs helps with a couple workouts, especially those related to balance. Easiest to notice if you're not accustomed to pushups. Blast out a set until you're exhausted, then feel your abs burn for the next few days. The stronger your core is, the heavier you can lift since you're no longer fighting your muscles to keep yourself in balance.
I've always felt wrecked after weightlifting. Sometimes I feel like I'm close to puking from the exertion and stress. I know it can be like that sometimes, but it makes it really unpleasant. I almost prefer actually doing the exercise to how I feel after.
Who can I talk to in order to shed some light on what's happening?
You can try http://www.reddit.com/r/fitness, there are some pretty knowledgeable people there. Also try searching there, similar questions pop up from time to time.
(My workouts these days are weightlifting ones as well, so it's not that I'm not doing comparable workouts.)
Just want to throw that out there. I still recommend going to the gym, and love it.