My post above didn't mention it, but I also learn new stuff. And some of it is really useful.
I don't insist the client use my preferred technologies. I may recommend them, sure, but in the end I'll learn what I have to do get the job done.
This whole thread reminds me of a story:
A small town barber has been cutting hair for decades, and charging his customers a fair price.
One day a national chain opens a salon just across the street and advertises $10 haircuts.
A customer asks, "Aren't you worried they'll drive you out of business?"
The barber grabs a piece of cardboard, scribbles something on it quickly, and props it up in the window.
The sign reads: "We fix $10 haircuts."
I think the best business model for an older developer is to fix $10 haircuts. Seek out those kind of jobs that capitalize on your experience.
There are so many messes out there that if you can bill yourself as a cleanup guy, you'll never run out of clients.
And this attitude is why older developers find it harder to get a job (I’m in my mid 40s myself).
What older coders have that younger ones do not, is experience. This can often halve the workload on some projects. The older I get in this profession, the more results I get out of less and less code.
I keep seeing this as an excuse for older developers who don’t want to keep up the date and stay marketable. Code is code. At some point you have to put lines in editor to make stuff work.
Also, let's not immediately fetishize the newer stuff. It is often a less well implemented retread of older technology. Seems like people have less patience for learning existing systems, so they just re-write some quick and dirty replacement and call it good. Perhaps it might be better if younger programmers learned the old stuff instead of just badly reinventing the wheel every few years.
The market can stay irrational longer than you can stay solvent.