I'm writing this up for the rOpenSci call on Codes of Conduct that I'm participating in today.
My lab has a lab Code of Conduct.
We adapted it from https://github.com/confcodeofconduct/confcodeofconduct.com. So the "how" was easy enough :).
Key points I want to make:
- develop & post a code of conduct whether or not you know of any problems;
- the code of conduct has to set expectations for everyone, including the boss;
- I provide a specific contact person outside the university hierarchy for complaints about me;
A few notes on why a CoC and what use it's been:
Adoption was not motivated by any one particular incident, although there have been a few incidents of problematic behavior over the years. It was more motivated by our adoption of a Code of Conduct for the khmer software project, which is one of our major projects, and also by the Software Carpentry Code of Conduct. (Note that Michael Crusoe was the originator of the CoC on the khmer project and has been both a strong proponent and an excellent resource for creating friendly workspaces.) The 2013 PyCon incidents helped convince me of CoCs in general. We also attended an excellent Ada Initiative ally workshop at PyCon in 2015 that convinced me of the utility of a CoC for the lab specifically.
Another motivation to adopt a lab code of conduct came from our training efforts, where it is clear that impostor syndrome rules and it takes quite a bit of overt friendliness for people to ask questions. Providing ground rules for interaction helps there tremendously.
I will note that there are a few unfriendly and/or obnoxious people in bioinformatics, and that at least two of these individuals have targeted students in my lab or collaborators. Not much to be done about that, although Twitter's "block" functionality works extremely well for me, or at least so I assume ;). I won't stand for that sort of behavior in the lab, though.
A lab code differs from a workshop or community code of conduct in a few ways. The primary difference I see is at the intersection of authority and longevity - unlike an online community, there is a de facto authority (the head of the lab), who within some limits can make decisions for the lab; this is like a workshop where someone can be asked to leave by the workshop organizer. But unlike a workshop, labs exist for a long time, and so there are longer term relationships to consider.
My goal in adopting a code was to make it clear that everyone could speak comfortably, without fear of being targeted for who they were or what they believed. I've come through both very macho and argumentative labs as well as super friendly and uncritical labs, and neither seemed right -- I wanted to maintain both the ability to give and take criticism within the lab together with having a friendly and productive lab atmosphere. I believe this is important for the development brainstorming and creativity, as well as simply making the lab a nice(r) place to be.
There have definitely been benefits in recruiting: having a code (and following it!) means that people know you are aware of many issues that all too many faculty seem unaware of... this encourages a more diverse applicant pool. This may be one reason the lab is fairly diverse in practice, as well.
A key aspect of our code is that it places expectations on the boss as well (that's me). Part of this is having someone to complain to about me; this has only been used once, and it was super important because I simply hadn't realized what I had said & done, and (long term) it led to me modifying a particular behavior of mine.
It also enables labbies to take the initiative when something comes up, which has happened a few times. This doesn't need to involve me; lab members have felt free to speak up and remind others that what they are saying is inappropriate or hurtful, in part because they know that we have set expectations and I will back them up. This seems to work well, the few times it has been used. (Although I've never had to back anyone up.)
Fundamentally a code of conduct defines a social contract and sets expectations for everyone in their basic set of interactions. I've found it to be a net positive with no downsides so far.
Final note: I have no idea if it's legally enforceable but I don't actually think that matters that much, as the university channels for handling harassment are largely useless in practice; this is a social problem too, not "just" a legal problem.