A big problem was that most bright engineers were promoted into management, so the ones left programming at 40 weren't so bright. So not so much that age killed the skills, it's just a selection bias.
I think we've got better at that and bright engineers are just being promoted into senior engineers, so hopefully it's fixing the selection bias.