I have recently had two older acquaintances independently ask me about how to get into programming. One is a retired air traffic controller (51 y.o.) and one is a lawyer who is burned out (47 y.o.). I told both of them what I tell anyone who asks me this question: it would be hard but possible for them to make the switch. I was very clear that it would require that they put in significant time, focus and work and that it would not be easy. I gave them a bunch of resources to start with and told them they could ask me questions any time. They are intelligent enough and I honestly believe that if they put in the time they could be pretty good.
The thing is, I am not sure I did the right thing. Age discrimination is a reality in this industry. Sure, there are older guys working as developers, but all of the ones I know have been doing it for 20-30 years. None of them got started so late. So, what kind of opportunities, realistically, are these guys looking at, provided they put in the time? I guess I am putting this out there to get other thoughts on the matter because I really just don't know.
Personally, I have changed career fields multiple times. What has worked for me is to build a bridge between what I know (the domain I was working in) and where I want to go next (targeted market).
For example, the lawyer can easily migrate to legal tech company and still be considered very valuable. Similarly, ATC can easily migrate to related industry tech company. Actually, their domain expertise will be considered valuable even now without programming knowledge in sales, sales engineering, and consulting roles for domain related tech companies and that might be a bridge worth walking on. Once they have entered tech space, it will get easier to build network and relationship and migrate toward development roles. This also avoids the need to restart from the bottom.
One thing I will suggest not to do is to quit their current jobs and go do some programming bootcamp/academic program. Their domain expertise is valuable as long as they are in the domain so leverage that to find a role in tech company focusing on their domain.