I have a similar story, too. I’m a retired programmer and for most of my 62 years, I thought I was in excellent health. Then, out of the blue one day, I suffered a pulmonary embolism. I had a blood clot behind my left knee which broke off. I very nearly died. This was a life-changing event. I wrote about it here: https://medium.com/@richardeng/im-really-worried-about-living-7cab778a2825
Since the hematologists cannot determine a cause for my blood clot, I’m on Warfarin medication for the rest of my life. I’ve taken to meditation exercise, which I believe helps a lot; bagua walking makes me sweat and burn a lot of calories, and meditation in general helps to lower stress. I am now a more philanthropic person; I continue to work for good causes.
Was sitting in front of the computer coding in C (primarily) responsible for my PE? Maybe. It was probably a contributing factor, though we can’t prove it. Was it my lack of physical exercise? Again, probably. Hematologists don’t look at lifestyle causes.