So I'm in an interesting position of having watched several of my family members deal with this - My father and two of my uncles do(/did) software development for a living.
My father ended up starting his own company in partnership with several of his then coworkers, he no longer develops and has transitioned to a sales position.
One uncle got out of the industry entirely.
One uncle is doing management at a software company started about 8 years ago (He absolutely hates it, but doesn't think he can swing another job change and is waiting until retirement in a year or two).
----
My take aways from watching them go through this:
- There seems to be a real wall at 45. Many of your early skills are expiring, you don't relate as well culturally with the younger devs at small shops, and you're too expensive for well established companies (why pay you extra for your 20 years of experience when they can pay a freshly minted college grad half as much?).
- Consulting is an option, but you need a strong grasp of a specialty area, and you need to be able to understand business and people problems more than software problems in many cases (this is essentially the route my father took)
- Management is an option, but A: It's not for everyone (My uncle is miserable). B: it's hard to swing a position in management without either taking a risky position at a very early stage company, working your way into it over several years, or having the right contacts within the industry to point you at new opportunities.
---
Personally? My plan is to no longer be in the industry at 45 (I'm mid 30s now). Ageism is absolutely real, and it's fairly pervasive in the software industry (and if I'm being honest, a lot of society in general).
I have 15 years or so to plan, and I've been experimenting with a variety of things I think I might enjoy as a breath of fresh air - I recently registered a company as an agricultural nursery in my state (focused on landscaping plants with a small division set aside for locally popular fruiting trees/bushes [blueberries, figs, stonefruit]).
I've also been doing hobbyist carpentry for several years, and I've recently starting taking commissions from family and friends (not really for profit yet, mostly to continue building skills and develop a network of contacts).
I'm also investing in property (Tax liens - not rental management or flipping).
---
My kids will be end of highschool by the time I hit 45, and I'm not convinced I'll be recommending they attend college, so I plan to have expenses drop dramatically.
When I'm ready - I plan to have a frank discussion with my employer at the time about cutting hours in exchange for cutting salary, with the end goal being to transition income to my other activities.