Week 45, 2019 - Respectful Code Reviews

From Google: “Respectful Reviews == Useful Reviews1”.

As a Reviewer or Author:

  1. Assume competence. Start by asking questions to gain understanding.
  2. Provide rationale or context. help others understand your decision or provide mentorship.
  3. Consider how comments may be interpreted.
  4. Don’t criticize the person. Instead, discuss the code.
  5. Don’t use harsh language. Code review comments with a negative tone are less likely to be useful.

As a Reviewer:

  1. Provide specific and actionable feedback.
  2. 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:

  1. Clarify code or reply to the reviewer’s comment in response to feedback.
  2. 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.