That's funny, because the goal is often to get at the truth. Is that an agenda you find objectionable? Do you see something noble in people who are harmed by the truth becoming known? "Bad cop" is not far from "devil's advocate" and the tension either creates is often useful to all involved. Is role-playing the same as deception?
> It's a way to behave toward an adversary
"Adversary" is very situational, and doesn't necessarily imply ill feeling - certainly not to the game theorists or jurists who often use the term. It's pretty common to have someone you generally want to work with be an adversary in a particular context. It's a role, and civil people get over it. In fact, codes of conduct - formal or otherwise - are often the very thing making that possible. They keep the adversarial role "in scene" and prevent it from turning it into permanent antipathy. Again, consider the "adversarial" nature of our justice system, one of the most formal and rules-bound environments most of us will ever see, whose participants are often on quite cordial terms outside the courtroom.
Yes, I think that's the wrong agenda to have when you're collaborating on software. A pull request shouldn't normally be an interrogation to figure out whether the person who wrote the code is lying.
That type of behavior has no place in a team setting.
Only if you forget that it's a metaphor. I suppose there's always someone who will take things super-literally and complain that the literal version doesn't match the current situation exactly, as a way of scoring points.
Well, guess what? I don't actually carry a badge and wear a blue uniform either, and I'm not suggesting that anyone here should. Nonetheless, I've been in many situations where having one person play skeptic/adversary and another play advocate can be productive. Not everyone is good at poking holes in their own idea so they can be fixed, or at defending their own decisions in an unfamiliar environment where others might have more expertise. Sometimes it's more extreme vs. moderate than aligned vs. opposed, but it still works. As I've pointed out in another thread, it's how our (USA) justice system works. It's how a thesis defense works. It's not the right approach for every situation, but it's not invalid either.
Or maybe I'm just playing devil's advocate here, to see how much others follow their own advice to act collaboratively. ;)
I'll go one further. "The nasty one" is a role that usually begs to be filled, even in a good cause. Sometimes it's even essential to progress. "Good cop, bad cop" works. I'm more likely to play "bad cop" myself, though at least I'm usually aware of it being a situational role. I've definitely said things that would have violated a CoC if there had been one in those situations, so I do understand the fear of them, but here's why I chose that particular metaphor: even the bad cop is usually working within limits. That dynamic can still exist, and still be effective, even within the limits of a CoC. People can still be demanding, critical, even abrasive ... and they will. They just can't be bigots or harassers and expect to keep getting away with it.