"First become a key, then go look for a lock."
Yes, there's risk in that, and no, there's no guarantee that whatever you specialize in will be useful to someone. But the advantage is that you're basically guaranteed to love your job, because you chose the job yourself and then just pitched a lot of corporations to see who was offering it. There's also a self-respect boost to being in the driver's seat and thinking of your career in terms of which organization gets to be lucky enough to have you work for them.
[1] https://www.ribbonfarm.com/2018/03/29/the-key-to-act-two/
We have to earn the generalist label - the generalist has his own form of specialization.
From what I’ve seen, the successful generalist’s command over the basics is so strong that you wonder why they never specialized deeper. The generalist has a good mental map of the territory and solves problems very proficiently, though perhaps not as quickly or rigorously as someone more specialized in a specific sliver of the problem domain.
(anecdotal from my own journey learning how to program and initially feeling frustrated by the lack of market for generalists)
As an example, I'm looking for a data scientist job and as you might guess, it is a very broad field. So, I thought I would learn the basics of machine learning, deep learning, required maths and programming and then I would search for the job and in whatever field I'll get the job like Natural language processing, computer vision, supply chain analytics, time series analysis, etc. , I would learn that and specialize in that field. But when I started looking for job every start-up wanted that I know current state-of-the-art techniques of their field, which is simply not possible as each start-up specialize in a different set of techniques, for example, some want deep learning, some statistics, some time series analysis, some big data processing frameworks like Apache Spark, some recommendation system and so on and so forth. As a result, I'm still searching for a job and somewhat have lost passion for data science.
So, the only learning that I got from going through this process is whatever field you choose, you have to specialize in that field to have a great career.