There is some truth in the idea that older people (like me) can't easily do the jobs that young programmers do. That's because young programmers mostly lack the ability to think, and rely on mindless memorization of a huge number of facts and associations, and tools (like auto-completion) that restrict their choices enough to avoid the bulk of errors they would otherwise produce. We used to call this "canned programming" (like heating a can of soup or whatever for dinner, rather than real cooking), but today, since that's overwhelmingly what programmers do, it's a seldom used term.
Older people can't in general do this mindless kind of programming because (1) our brains have sacrificed the memorization ability for ability to reason (like, heuristics, example problems/solutions, so on), and because (2) it is to large degree a social thing, picking up hints about the latest ephemeral mayfly technology from one's multitude of friends & online activity.
Conversely, where the programming calls for some reasoning ability, older people are best.
Here's a science fiction book that is both fun and interesting, dealing with this problem:
Rainbow's End by Vernor Vinge.
Cheers & hth., only my opinions of course,