This is a discussion that always happens, in just about every context. It also depends massively on perspective.
Take somebody who codes java and haskell, does database admin and web design, and hacks the linux Kernel: I'd call her a generalist. But from a wider perspective she might be a specialist: concentrating on hacking rather than literature, or business, or physics. It's all relative.
[Incidentally, I'll mention that Isaiah Berlin's essay 'the hedgehog and the fox' is a classic of the 'generalists vs. specialists' genre, applying the division to writers and philosophers. I'm not a massive fan of it (dividing people up like that gets a bit superficial), but looking up papers citing it will get you into the recent literature on the subject]
the key advantage that a generalist has over a specialist is being able to
adapt to constantly changing conditions quickly and more easily... from the view of self-interest,
given parallels in the animal kingdom (racoons have survived even with their
natural habitats destroyed, ...) - it's the way to go
That being said, it's important to have a broader knowledge so you can actually communicate with other team members intelligently and effectively. Simply specializing in a field, and mastering it, can sometimes lead to weird and uncomfortable "siloing" of tasks.
[Incidentally, I'll mention that Isaiah Berlin's essay 'the hedgehog and the fox' is a classic of the 'generalists vs. specialists' genre, applying the division to writers and philosophers. I'm not a massive fan of it (dividing people up like that gets a bit superficial), but looking up papers citing it will get you into the recent literature on the subject]