It may be true that youth confers certain physical and mental benefits, but I feel it's generally under-appreciated what a massive amount of value older people can still easily bring to society around them.
I grew up as a young 20-ish programmer in a FOSS community that had multiple people in their 60s and 70s act e.g. as module maintainers and similar, and you can be productive and matter and contribute to greater things for far longer than most people seem to assume.
The bottom line is perhaps more that "finding ways to apply yourself" and doing the right things is challenging at any age.
I grew up as a young 20-ish programmer in a FOSS community that had multiple people in their 60s and 70s act e.g. as module maintainers and similar, and you can be productive and matter and contribute to greater things for far longer than most people seem to assume.
The bottom line is perhaps more that "finding ways to apply yourself" and doing the right things is challenging at any age.