Keep bragging

Notes on technologies, coding, and algorithms

Code review guide

Goals of code review

There are many goals of peer review of committed code, here are some of them:

While it is obvious, the following are not the goals for code review:

Prepare for code review

What to review?

Reviewing code is more of an art than a science. There are a lot to learn what to review. While there is no defined laws, we can follow a checklist:

Purpose:

Design:

Code standard:

Security:

The other rule is to keep the reviewing light and fast, focus more on the program logic instead of styling. Let automation tools to do styling check.

How to respond to peer review?

The purpose of peer review is to improve the change request. Therefore, don’t be offended by reviewer’s suggestions and take them seriously even if you don’t agree.

Key issues

About comments

Naturally, blocks of code whose purpose isn’t clear should be commented.

Some comments are useful for maintenability, code quality, and collaboration; but excessive comments, or useless ones that state the obvious clutter up code, which should be avoided.

###

Reference