One of the behaviors I regret most from my newbie beginning as a software engineer was my reluctance to participate in code reviews. It’s not like I had much choice in the matter, but I didn’t like it. I felt judged.
Today I want to talk about why this is wrong and how you can make the most out of these reviews.
Tapping Into a Colleague’s knowledge
As time flew by and more and more code reviews happened with different people, I realized that code reviews are unique opportunities to tap into the vast knowledge someone else - probably more experienced than you - has on certain topics.
And those are opportunities that don’t happen often. For example, if you usually work on Python code and you have an opportunity to work on Kubernetes - the person in your company who is going to review that code is probably very knowledgeable and you can ask them a lot of questions during the review - not necessarily about your code.
Your Code is ineffective Especially if You’re New
One of the reasons we don’t like Code Reviews when we’re “fresh” out of college, or wherever you studies is for the same reason we don’t like it when people criticize us in other areas of life - we don’t like to feel weak or when people judge us. It’s a feeling that our minds don’t like - the same as being attacked.
But what I had to learn is that my code is pretty lame and I could have done a lot of things better. And that’s what code reviews are here for - to learn.
If someone is judging you personally during a code review it’s wrong. The code should be the focus. And there’s a lot to judge about your code in your early days.
Also, sometimes you’ll find that your code is lacking planning for the broader picture - something that a team leader is usually more privy to.
Add Code Reviews to your Second Brain
Most Code Reviews happen on GitHub or some other git software. Your reviewer will leave notes on your code. Many times, especially when you’re new, you’ll find that those comments are “lightbulb” moments. Don’t let them linger in those reviews never to be looked at again. Add it to your second brain and make sure it’s searchable when you need it.
In addition, write your original code piece and document why that comment is a better approach.
Conclusion
Code reviews are a gift. You should utilize them for advancing your knowledge and don’t look at them as a way to judge you. Understand that you’re not perfect. You will make mistakes and the code reviews will help you learn so you won’t make the same mistakes next time.
And if you “digest” your code review notes into your second brain, you’ll make the most out of them.
I hope that helps! Thank you for reading.
What has been your experience with code reviews? Let me know in the comments below!