Lesson 2 · Unit 03
Saying it
Specific, about the code, with a next step
What you practise
- Specific, about the code, with a reason
- Questions against demands
- Blocking against optional
- Examples rewritten from harsh to useful
Try a question from this lesson
Pick one
Four reviewers comment on the same line, which crashes when a list is empty. Which comment is most likely to get the bug fixed without an argument?
Correct answer
Crashes when items is empty: items[0] fails. Return 0 first?
Why
It names the input, says what happens and offers a way out, so the author can act at once. The others leave the author guessing what is wrong, or defending themselves instead of the code.
The ideas
Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.
Concept
A comment that works
A useful review comment has four parts.
Where: the exact line. What: what happens, with an input that shows it. Why: what it costs. Next: a concrete suggestion, or an honest question.
It is about the code, never the author. "This crashes on an empty list" can be fixed. "You are careless" cannot.
Concept
Say how much it weighs
An author who gets twelve comments needs to know which ones must be handled before merging.
One widely used convention, Conventional Comments, puts a label first: praise, nitpick, suggestion, issue, question. A decoration in parentheses, such as (blocking) or (non-blocking), says whether it holds up the merge.
issue (blocking): The refund is sent
twice when the request is retried.
nitpick: "recieve" is misspelled.
question: Can items be empty here?9 more exercises in the app
- 4× multiple choice
- 1× match the pairs
- 1× true or false
- 1× fill the blanks
- 1× type the answer
- 1× order the lines
Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.