This content originally appeared on Level Up Coding - Medium and was authored by Anas Anjaria
Code reviews
My Takeaways — Implementing a Strong Code-Review Culture
Code reviews are not about catching bugs. It’s about discussing a solution with your peer.
I stumbled upon this excellent video on code reviews.
Here are some of the things I learned.
- Code reviews are not about catching bugs.
- It’s about discussing your code with your peers.
Since it’s about discussion, so there are 2 actors involved.
- Author of a pull request.
- Reviewer of a pull request.
Rules of engagement for the actors
As an author …
I have learned to add context to a commit message. It means:
- Our commit message explains “WHAT” is being done in this specific commit.
- But it does not explain “WHY”. This “WHY” is the context.
Our changes are there to solve a specific problem, but if we add “WHY”, then our peers could have a better understanding of a problem and could provide a better solution.
This could change the whole picture. Furthermore, it’s would be well documented in our commit history.
As a reviewer …
The rule is …
ASK, DON’T TELL
Actually, I am already aware of this rule and am following it. I have covered this point in detail in my article, Lessons I Learned as a Code Reviewer, under the section.
No “YOU” attitude while requesting changes in pull requests
So, how do we start a healthy debate?
Here are some tips specified in the video for reviewers on how to engage and open a healthy discussion.
What do you think about… ?
Did you consider … ?
Could you please clarify … ?
Finally, the presenter highlights the key benefits of the strong code review culture and they are as under.
- Better code
- Better developers
- Team ownership
- Healthy debate
Thanks for reading.
If you enjoy this post, you might also like the following series.
Want to connect?
Facebook | LinkedIn | Newsletter | Twitter
My Takeaways — Implementing a Strong Code-Review Culture was originally published in Level Up Coding on Medium, where people are continuing the conversation by highlighting and responding to this story.
This content originally appeared on Level Up Coding - Medium and was authored by Anas Anjaria
Anas Anjaria | Sciencx (2022-10-04T15:48:42+00:00) My Takeaways — Implementing a Strong Code-Review Culture. Retrieved from https://www.scien.cx/2022/10/04/my-takeaways-implementing-a-strong-code-review-culture/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.