So it goes: new folks get into oil and gas during a boom and expect it never to crash. Then it does- it always does. Sometimes the crash lasts a long time- a decade or more. Sometimes it's over in six months. This one has lasted over 6 months already and I think it's got some staying power.
Oil and gas is, was and ever will be a cyclic industry, which is why they have perpetual problems with "shortages". The people dumped en masse on the labour market during the bust periods find something else to do and when the bust is over, many of them either don't want to go back, have moved away to where the work is and settled their family there, or are no longer considered to have skills which are sufficiently "current" and hence no longer wanted.
Less people SHOULD enter into "the industry" when fewer are required. The flipside of that is companies who actually want to hit the ground running when the next boom comes, need to continue to hire and train some young people- they will have no trouble finding more than enough young people who are willing to be trained. Regrettably, what will happen is what has always happened- those with least seniority will be turfed and hiring will slow to a crawl, leaving another hole in the labour market which will cause these companies to scream "shortage!" again when the next boom hits.
As far as the young people "wanting to code", it's a set of easily transferrable skills that they come out of school with, which can get them a job of some sort in innumerable industries- it's the path of least resistance for a lot of them, but it too is a flooded market. It sucks to be a fresh grad engineer these days.