This article is the product of a lot of years experience and observation, and I'm still trying to get it clear in my head. Which means I'm hoping the conversation will clarify the message.
In my nearly 40 years of writing software I've had many people suggest I should change course because of x, y, or z. Currently Large Language Models or AI are going to replace all programmers, previous to that it was off-shoring, previous to that it was RAD (Rapid Application Development systems). I'm guessing the replacement of machine code with high level languages and terminals for punch-cards. Every advance in productivity is gleefully portrayed as the end of our careers.
And yet here I remain, still making a living, making things...
So why is industry so focussed on making us redundant? With very little evidence I believe that programmers are a pain in managements bum. They didn't want to pay my wages, the didn't want to pay for the high cost of career maintenance (training etc), they didn't like that I knew things they didn't, which made a lot of their management levers ineffective. In short I was a problem that needed solving.
Here are some of the management "solutions"
Document code so that a person off the street could replicate it ... Had that suggested a couple of times.
Can random person shadow you to learn what you do, called pair-programming now I believe.
Use a framework, tool to break a problem in parts so small that the system can be maintained by low skilled operators.
Shipping code off-shore chasing the lowest wages.
Various processes aimed at removing the skill involved in developing complex systems.
You may think that I'm against all of these, well I'm not, because often they can be a force for good. They are bad when they are implemented by management that doesn't understand you need good people and those good people need rewarding.
What if we go the other way? The rockstar programming god is also a problem I've observed. They take advantage of management ignorance to instil fear, source code is hidden and protected. I've fixed a few jobs left by these and it's always hard and management always think their rubbish code is the work of a tormented genius.
And here lies the conundrum...
A lot of the tools, processes and methods that make us better engineers can also be used by management to commoditise our work.
What is the key to the conundrum?
I think it is empathy and focus on delivery. It's a hostile act if all management want to do is reduce your cost or value. It's a similarly hostile act to make something extremely complex so you are the only one who can support it.
In the middle is the work, as a programmer delivery is key to a long and happy career. In management concentrate on the ROI of having a great team, rather than just the cost. Outside of just the work, a great team will have so much domain knowledge you can draw upon. Add to this flexibility, support and improvements that would be built in just by leveraging your highly skilled staff.