That is not a way to judge any field. Pursuing any field or career should be according to your interest. What if you joined Electronics and it has the market but you didn’t find any interest to continue.
So all of things can happen but what you should do is choose career according to your interest. Regarding the layoffs, I think Computer is one of the growing things in the world.
Do watch this video where Steve Jobs and Bill Gates and many more talk about the necessity of more computer engineers and programmers.