Or a young woman, of course! But if you're in your late 30s and you still spend the majority of your time at work writing code you'd better be really good.
They don't prepare you for this in college or admit it in job interviews. The harsh reality is that if you are middle-aged, write computer code for a living, and earn a six-figure salary, you're headed for the unemployment lines. Your market value declines as you age and it becomes harder and harder to get a job.
I know this post will provoke anger, outrage, and denial. But, sadly, this is the way things are in the tech world. It's an "up or out" profession -- like the military. And it's as competitive as professional sports. Engineers need to be prepared.
This is not openly discussed, because employers could be accused of age discrimination. But research, such as that completed by University of California, Berkeley, professors Clair Brown and Greg Linden shows that even those with masters degrees and Ph.Ds have reason to worry.
Basically as you get older you need to diversify your skills beyond coding. As a software engineer in my late 30s, I'm not sure this is "age discrimination" -- you can't keep doing the same work and get 5% raises every year. Sure, you've got a family to support now, but that doesn't entitle you to more pay: you've got to create more value! Integrate your deep experience with software development with some other skills and you'll be golden:
Move up the ladder into management, architecture, or design, and diversify your experience. Work with business executives in your company, in areas such as sales, finance, marketing/product management, legal, and operations. Develop a broader set of skills that make you more valuable to your employer and that differentiate you from others with just coding skills.