Step 14: Code Reviews ~Mattias Karlsson

Birat Rai
3 min readOct 7, 2017

--

This is the Fourteenth Step towards gaining the Programming Enlightenment series. If you didn’t learn the Thirteenth Step, read it.

“Self-assessment is a powerful tool. It allows you to be Honest with yourself and free from outside influence in your own space.” ~Joel Spolsky

How many times we fear the dread before opening up a pull-request, somebody is going to comment on some piece of code I did wrong, or there must have been some better way to do it. Believe it or not, doing Code Review of your own Pull-Request will help you gather a lot of insight into the code that you are doing pull-request for.

What is Code Review?

It’s a systematic examination also referred to as peer review of a source code.

A beautifully laid out code means we can see structures of code which gives up certain shape in our mind and gives us understanding where to navigate to find our certain piece of code and make change.

Do a Self Code-Review before asking your peers to do it.

Why do Pull-Request and Code-Review?

The purpose of pull-request is to let others know about the changes you are going to push to a repository. It let’s us discuss and review the potential changes with collaborators and add follow-up commits before the changes are merged.

Sure it takes some development time, but if done right, code-reviews actually save time in the long run. And, let’s developer write better code.

Don’t take reviewer’s suggestions personally. The suggestions and arguments helps you grow as a better developer. Always be grateful for the reviewer’s suggestions, they are doing it out of their productive time.

How to do Pull-Request and Code-Review?

There are a host of tools that allows us to make pull-request and let the peer do the Code-Review. GitHub, BitBucket, GitLab etc are the famous tools actively used.

Automated code analysis using Static Code Analysis tool will also help clean up the code. Some notable are CheckStyle, PMD, Lint, FindBugs

Always try to make your pull-request for a minimal changes.

TL;DR Suggestions always help. Do a small Pull-Request often and ask for Code-Review first with your self and with your peers.

--

--

Birat Rai
Birat Rai

No responses yet