My 2 supervisors were in their 50s, and started out slinging bags on the tarmac. Knew their stuff cold...not just about the tech, but how to actually deal with and manage people. Lots of life experience shared with this very green kid who on paper was the technical 'expert'. And because they'd been there and seen waaay more than just the inside of an office, they understood the business we supported intimately. "Knew were all the bodies are buried" was the key phrase. I went on to consult with a Very Large Telco, which had a similar culture of valuing experience and worked with some of the most knowledgeable techs I ever met, most several decades older than me. Shoot...there was a lot of grey hair at IBM when I was there, before someone decided ageism as official corporate policy was a swell idea.
And that has made all the difference.
I'm in my late 50s and have been programming professionally for 30 years or so. And, right now, I'm being mentored by 78 year old engineer still writing code every day!
I now try to pay back that mentoring investment, and I encourage other people in the last half of their career to do the same - much of the challenge of software as an occupation and avocation is self-doubt and mentoring really helps provide objective feedback and perspective on what is truly important.