Personally I don't think it's anything to worry about for the vast majority of people, only those rare outliers of both brilliance and industry are going to see significant negative effects in their output due to age-related mental decline.
In terms of individual peak production the greatest pop stars, physicists and poets (say) are done by 25. Your average decent coder can pretty much go on producing for decades.
Only at the extremes is this going to have a massive effect. Most of us don't live there and we maybe over-worry about it.