Is It Better to Be a Generalist or a Specialist?