Noob question: What is the motive of a code-review...
# random
s
Noob question: What is the motive of a code-review? What do you look for, when a review is raised to you? Is it also done to allow a quick look into the code for the reviewer?
c
Everyone has a different take on this. I personally look at below: 1. If the code is following correct standards and also if it is correctly formatted or not. 2. Go through the description and see if the logic looks correct or not. And if the test cases are written then check if they are covering all the cases or not. 3. Also think of reusing the existing code (DRY) or making the this code generic to use for others as well. 4. Think of more corner cases if they are missing from code (Eg: Null input, empty strings, etc.) Curious to know what other opinion others share.
1
g
I'm doing a lot more reviews now than actual coding, It's everything @cuddly-teacher-92140 mentioned, except #1. We let the linters in pre commit hook take care of formatting and most conventions so reviewer's time is saved. It will also help a lot to read other people's code, lots of learning opportunity on what to do/not to do. Few links I found helpful: • https://stackoverflow.blog/2019/09/30/how-to-make-good-code-reviews-better/https://mtlynch.io/code-review-love/https://google.github.io/eng-practices/review/
Previously when in a large team, doing (good) reviews helped to substantially raise my visibility across the org. So it's also helpful in a career focused way also. But the quality of the reviews do matter. There used to be one person who used to comment "spacing", "extra line", etc. But those are not helpful. So we added code formatters and linters to save on a lot of time.
m
Our Contribution guide. PR Description bullet points. Pre-commit config. Minimum three approvals are required to get a PR merged. We welcome reviews from the community as well.