This specific person has 17 years of experience. Are they a staff level engineer, critical to their group? 17 years is more than enough time to become more competent than >99% of software engineers, if they have the aptitude for it. It seems unlikely that a company would layoff someone keeping all the juniors unblocked, unless management is totally incompetent.
Or are they a senior with a decade of negotiated raises, who hasn't learned anything meaningfully new in that same time? They have something like 7 years of real learning, and the company is paying for 17. This is an obvious choice for a layoff.
I haven't seen any signs that smart people who can write software are valued any less. They are just as hard to find, and are getting paid just as much as ever.