For anyone interested in a (potentially) helpful framework for how to evaluate opportunities and avoid burnout, you can watch my talk here - https://vimeo.com/202061452
Just some thoughts on caffeine, since I think stress in programmers is often caused by it, or covered up: I only very rarely have caffeine, and rather do vitamins if I need to be more stress resistant (Vit C, D, K2, Pantethine and sometimes B vitamins). That way I'm not fooled by the motivation that comes with caffeine, which somehow covers up what I really want to do. If I have caffeine I get giddy about the thought of writing this and that tool, while I couldn't care less when off caffeine.
It's hard to describe, but I can quite easily get "into the flow". This is where I focus on a single project, time cease to exist and I just become one with the code. I can focus on coding for hours and hours without break. In fact, lunch and toilet breaks are irritating distractions. I can go to sleep at night uneasy about something I'm not exactly sure about and suddenly the solution strikes me when I'm half awake in the shower next morning.
I don't use much caffeine, a bit of coffee in the morning, rarely in the afternoon – however I do know that coffee and alcohol makes my condition worse.
It's totally engulfing and extremely productive. This _is_ the mythical man month that people talk about. Only. For me it takes a toll. It's not about any underlying stress like "I won't make it in time". My work is luckily such that I don't have much pressure. It's being "in the zone" that is the problem.
The "flow state". I love it yet mustn't overdo it.
I probably would be able to get back into that state if I somehow managed to get all my responsibilities squared away for large periods of time-or alternately, convince myself thoroughly enough to ignore them.
Sounds like you have a medical condition for dealing with stress, but most people don't have that kind of condition, so obviously if you have that kind of condition you should watch out for yourself, health is everything.
Also. The fact that I can control it by observing the signs my body gives me...
I strongly disagree with this. I'm a compulsive person, I used to say yes to everything, I enjoy everything. I don't think I ever spent effort towards something that wasn't rewarding in some way or other.
However. Stress is stress and it can be negative or positive. Stress makes you perform better, adrenaline pumping, your senses sharpen. It can all be in a positive loop with great feedback, everyone loving what you do, amazing results, and still you end up burnt out.
My stress manifests physically, "skipped" heartbeats, adrenaline rushes when waking up in the night, I even got atricular fibrilation (AF) and was hospitalised to be "reset" through one of those heart machines you see in ER. I was convinced there was something very wrong with me. Heart problem? Doctors did test after test, and nothing.
I learnt my lesson, I know how to recognise the signs now. I can manage it by just taking care of myself.
But guess what, every single thing I do is fun, positive, great feedback.