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.