Week 45, 2019 Respectful Code Reviews
From Google: “Respectful Reviews == Useful Reviews1”.
As a Reviewer or Author:
- Assume competence. Start by asking questions to gain understanding.
- Provide rationale or context. help others understand your decision or provide mentorship.
- Consider how comments may be interpreted.
- Don’t criticize the person. Instead, discuss the code.
- Don’t use harsh language. Code review comments with a negative tone are less likely to be useful.
As a Reviewer:
- Provide specific and actionable feedback.
- Clearly mark nitpicks and optional comments by using prefixes such as ‘Nit’ or ‘Optional’. This allows the author to better gauge the reviewer’s expectations.
As an Author:
- Clarify code or reply to the reviewer’s comment in response to feedback.
- When disagreeing with feedback, explain the advantage of your approach.
Research shows that within just one hour, if nothing is done with new information, most people will have forgotten about 50% of what they learned. 2
Techniques to commit new knowledge to memory:
- Spaced repetition. Spaced repetition leverages the spacing effect3, a memory phenomenon that describes how our brains learn better when we separate out information over time.
- The 50/50 rule. Dedicate 50% of your time to learning anything new and the rest of your time to sharing or explaining what you have learn to someone or audience.
- Topic demonstrations. Make the most of topic demostrations to understand a topic inside out.
- Sleep after learning. Sleep after learning is a critical part of the memory-creation process, and sleep before learning strenthes your capacity.