I'm 63 but learned to code a long time ago. My ability to see connections, abstractions and the like is better than ever. I do find that distractions like background noise or other competing tasks reduces my ability to solve the complex problems. I have to really isolate and focus. I also find benefit from listening to http://brain.fm