When I worked in consulting, I was constantly thrown into work I had little idea how to approach; build us a PoC of a mobile app in React Native, spike out an event streaming backend running on K8s, see if you can index a few hundred unstructured Word documents to make them searchable, etc.
I found this to be terrifying yet exhilarating. The short timelines of these projects (averaged six weeks) coupled with the "tech spike" nature of the work gave me countless opportunities to experiment with different technologies and approaches to problem solving. While the architecture and code weren't often the best, they served their purpose well as demos.
What constantly nagged at me however was the outlook that I'd always only gain surface-level knowledge of the things I work with; by the time the implementation was working, it was time to move on to something else. This eventually caused me to move to an engineering role in a product company where I'd get the chance to specialise in an area I was passionate about.
Fast-forward to now, where I've spent almost a year in the same codebase working to solve problems in the same domain. I've picked up an immense about of knowledge on Go, REST APIs, and good engineering practices, but I can't kick the feeling that having such a narrow focus is detrimental to my learning.
I'm sure I'm not the only person who's felt this way, and I get there are tradeoffs with both approaches. Has anyone managed to strike a balance? Are there good reasons to favour one over the other?
The above is of course purely theoretical and all depends on how you're going to compose your "T" in both: the generalist part and your specialization.
For instance and contrary to a popular believe, a model in which the base of your "T", the generalist part, is narrower but you know a little bit more about every topic than just scratching its surface like in the above paragraph, is not an optimal one. It might be even a waste of precious time.
Consider risk management of both strategies and their statistical implications. The first one is much better suited for dealing with unpredictable, real (volatile) world than the second one, although it's not intuitive at the firs glance. But it's very important to understand that risk mitigation and hunting for chances in life has exactly the same profile (they are mirrored to each other). It's called a proper (beneficial) convexity [take a look on Nassim Taleb and his works - highly recommended] when you're set up in a way that enables you catching good winds and ride a wave of opportunities (and in case of Taleb's antifragility models - even disasters).
There is no balance! There are only trade-offs between risk and chances of success. Positioning oneself in a good direction is the key, and in the world where "I have no idea what I'm doing" MUST BE a norm, being a generalist-specialist is a very, very good starting point. With time passing by one can easily fulfill spots that should be strengthened. It's much easier to do than pivoting from a bad place we've found ourselves in due to inappropriate, past decisions.
Again, read Nassim Taleb. At least The Black Swan and Antifragile. You're going to thank yourself later.