40 is likely the average age programmers start to reject the concept they need to be available 24x7x365, and realize the SV or startup mindset pays off only in a small number of cases. Odds a bit better than a lottery ticket.
I did not start to put limits on my dedication to a job until I was 50, and now at times feel I could have better used the last decade - more living / less toiling.
Along those lines (I'm in my early 40s, been programming since I was a kid, working in software since I was 20) my tolerance for BS is at an all-time low and I've been at this long enough now to know my own worth. There are loads of jobs out there, but not many I can be convinced to sign up for.