I'm at the tail end of a career, and found that specializing in a stack can be great when you are in mid-career and the stack is hot. You don't want to specialize too early because it pigeonholes you. And you don't want to stay specialized too late, because your skills stagnate. But I rode one stack for 15 years -- got in it when it was young, did great in it for 5 years, then once it declined, I spent 10 years helping people shut it down and transform to new stacks. In the process picked up the next stack to specialize in.