I am a retired Software Engineer. I made a very good living cranking out code. The reason why I made a very good living is that cranking out code day after day is very challenging, and relatively few people have the talent and skills to do that year after year. Maybe there are some coal miners who could be retrained to code, but my sense is that would be the exception to the rule. And the vast majority could not handle that kind of career change.