Or move away from low value front-end junk that turns over every three years (the latest JavaScript framework of the month), and to higher value serious programming. That's where long-term job security comes from. The difficulty acts as a barrier to entry against a flood of low skill labor that will constantly undercut you (both in regards to age and income). Master a high value, higher barrier to entry language or two and you can write a six figure ticket for the rest of your adult life. And as certain languages begin to themselves age off, the demand often only goes up for the dwindling supply of engineers that still know it well.