Introduction
An open-source project is a group of people who mostly never meet. They live in different countries and time zones, speak different first languages and work when they have time. Nearly everything happens in writing: issues, pull requests and mailing lists. Whether a project is pleasant to work in depends on how people write to each other, and many contributors stay or leave because of it.
This lesson covers how to write messages that get answers, how to disagree, and the code of conduct, the document that sets the rules for everyone.
How it works
Communication is asynchronous and public. Nobody answers at once, and anyone may read what you write, today or in five years. So make each message complete: someone who reads only that message should understand it.
To ask a question, say what you want to do, what you tried, what happened (with the exact error) and what you expected. Search first: the answer may be in the documentation or in a closed issue. To answer, be patient: you were a beginner once, and the person asking may not speak English as a first language. Plain words and short sentences help everyone.
To disagree, talk about the code or the idea, give a reason and suggest an alternative: "I am worried that this slows search down; could we measure it first?" Never write about the person. Tone is easy to lose in text, so assume good will and read a harsh message twice before you answer. If a discussion goes in circles or on small matters (bikeshedding), ask the maintainers to decide, and accept the decision.
A code of conduct is a short file, CODE_OF_CONDUCT.md, that says how people must behave: be respectful, accept criticism of your work and give it kindly, and no harassment. It also says who to contact and what can happen: a private warning, a temporary mute, or a ban. Many projects use the Contributor Covenant as a starting point. Maintainers who enforce the code of conduct do moderation: they read reports, decide fairly and act in proportion, usually in steps, starting with a warning.
You can also help by being the person who thanks others, answers a newcomer's question and says when something is unclear in the docs.
Example
BANNED = ["stupid", "idiot", "garbage"]
comments = [
("ana", "Thanks for the report, I can reproduce it."),
("bo", "This code is garbage."),
("cy", "WHY IS THIS STILL NOT FIXED"),
("dee", "Could you share the full error message?"),
]
def problems(text):
found = []
lowered = text.lower()
for word in BANNED:
if word in lowered:
found.append("insult: " + word)
letters = [c for c in text if c.isalpha()]
if len(letters) >= 5 and all(c.isupper() for c in letters):
found.append("shouting")
return found
flagged = 0
for author, text in comments:
found = problems(text)
if found:
flagged += 1
print(f"{author}: {', '.join(found)}")
else:
print(f"{author}: ok")
print(flagged, "comment(s) to review")Line by line
BANNEDis a short list of words that a project does not allow.problemslower-cases the text to find insults, and flags text that has at least five letters, all in capitals, as shouting.- The loop prints each author with their problems, or
ok, and counts the comments a moderator should look at.
Expected result
ana: ok
bo: insult: garbage
cy: shouting
dee: ok
2 comment(s) to review
In the real world
Large projects have moderation teams and, in some, a rule that every conversation is held in public so that nothing is decided in secret. Bots help with the first step, flagging comments for a human to read, but a person decides what to do. A friendly place is also a practical advantage: projects with a clear code of conduct keep more contributors and get more of them back.
Common mistakes
- Posting "any update?" or "+1" again and again. Use the reaction buttons, and give the maintainers time.
- Taking a short review comment as rude. Reviewers are busy; ask if you do not understand.
- Arguing in capital letters or with sarcasm. It ends discussions, not settles them.
- Asking in private (mail, social media) what belongs in the public issue, so that nobody else can learn from the answer.
Best practices
- Write messages that can be understood alone: context, steps, result.
- Be kind, thank people, and say what you appreciate.
- Disagree with the idea, with a reason, and accept the maintainers' decision.
- Read the code of conduct before you take part, and report a problem privately to the contact it names.
Summary
Open-source communication is written, public and slow, so every message should be clear, complete and kind. Disagree with ideas and give reasons. The code of conduct states the rules for everyone, and moderators enforce it in proportion, usually from a warning up to a ban.
Quick check
Key takeaways
- Open-source talk is written and public: be clear, specific and kind.
- Say what you tried, what happened and what you want, so that others can help at once.
- The code of conduct tells everyone what is expected and what happens when it is broken.
- Disagree about the code and give reasons; never attack the person.
Practice problems for this lesson
Was this lesson clear?
My notes
Write down what you want to remember from this lesson. Notes are saved on this device as you type, and appear on your dashboard.