I have a theory: perhaps the reason programmers may peak in their 30s has to do with programmers changing their roles later in their careers to where they spend less time coding and more time doing other tasks. For example, junior- and senior-level software engineers spend a lot of time programming. However, staff-level software engineers are more involved in high-level architectural decisions, and there are also many mid-career software engineers who transition to management.
We see something similar with researchers. PhD students are typically in their 20s; they are focused on their thesis research, and the thesis work is done alone since a PhD is earned based on individual effort. However, the role of an assistant professor in computer science is very different. Aside from teaching and service requirements, assistant professors are responsible for carrying out an entire research program, which involves fundraising (applying to grants, soliciting industry for funding), recruiting and advising grad students and postdocs, and keeping up to date with the latest research advances in the field. There is less time for individual coding, and additionally hitting the productivity metrics many universities expect for their professors requires having a lab instead of working individually like a grad student or postdoc.
One thing I've noticed as I've reached my late 30s is I'm less hungry to learn new things, and I used to be very intellectually driven. I'm increasingly tired of keeping up with everything and proving myself.
I think if you can stay hungry then you can stay good for longer. But maybe it's partly motivation, and partly raw ability. Maybe they're somewhat linked.
I mostly code in C, C++, Python, Emacs, Almquist, GNU Make, and VanillaJS. I have been for more than two decades. My website looks like danluu.com and bellard.org. Why do I need to change?
We see something similar with researchers. PhD students are typically in their 20s; they are focused on their thesis research, and the thesis work is done alone since a PhD is earned based on individual effort. However, the role of an assistant professor in computer science is very different. Aside from teaching and service requirements, assistant professors are responsible for carrying out an entire research program, which involves fundraising (applying to grants, soliciting industry for funding), recruiting and advising grad students and postdocs, and keeping up to date with the latest research advances in the field. There is less time for individual coding, and additionally hitting the productivity metrics many universities expect for their professors requires having a lab instead of working individually like a grad student or postdoc.