Meaningful Code Reviews
https://tech.olx.com/may-the-code-review-be-with-you-3407955e4c19

Meaningful Code Reviews

When I started reviewing code — early in my career — I felt unproductive. It wasn’t clear how I was contributing to the product without writing code. I only did code reviews out of tradition, something you do before merging changes. Since then, my perception of code reviews has evolved from a soul crushing tradition to an opportunity to learn and improve the code quality.

Code review is a great learning opportunity, especially for junior developers. I have learnt a lot about software design and common mistakes from giving and receiving reviews. You can also learn a lot about a team from their code review comments. The next time you join a team, go through the comments in closed pull requests, a treasure trove for understanding the product and team dynamics.

The first time I reviewed code I felt lost. I didn't know where to start or what to look for. But I have grown and left my childish ways. Now, I first check whether the changes fulfil their purpose, does it do what it is supposed to do? Other times, I am tempted to check for code style violations but this is not the best use of my time. To avoid the temptation, I advocate for the use of linters and formatters like tslint and prettier.

After confirming that the changes work and do not introduce defects, I shift my focus to the design. Software doesn't become spaghetti over night but through innocent acts of ignorance. I scan the code to see where duplication might have occurred, then I make sure that we haven’t broken any of the SOLID principles or that we’ve broken them within reason. I also look for opportunities to improve the code with design patterns or with the framework’s or programming language's idiomatic implementation.

The other thing that I care about in code reviews is names. Most of the time we don't care what we call things until we have to read them in the future. I make sure that the names communicate their intent, are meaningful and can be pronounced.

During code reviews, I aim for respective collaboration as it is easy to let your frustration leak through your review comments. Understand that the author takes pride and feel validated by their work, so criticise cautiously and politely, after all, the bugs are the bad guys not the author.

Letania Ferreira, PhD

Bridging the gap between communication and tecnology

3 年

Great summary of ideas. Thank you for taking the time to put this together :)

回复
Daniel Maina

Software Engineer 6+ years | Backend Development | Golang | Blockchain | Interested in Protocol Development

5 年

Nice one Japheth Obala

回复
Joshua Enos

Backend Software Engineer | Spring Boot | Distributed Systems

5 年

Great article Japheth Obala

Arnold Osoro

Backend Software Engineer @ Equity Bank Limited | Python Django, MYSQL

5 年

I felt that way at first since I didn’t know much but over time I got to appreciate the importance of code review. Great read

Rodgers Kishagha

Software Engineer || Typescript || NextJs || React|| Redux || NodeJs || SQL

5 年

Great article Japheth Obala. You nailed it on the naming section. Proper naming plays a great role in code maintenance as well.

要查看或添加评论,请登录

Japheth Obala的更多文章

  • Beauty Is Good For You

    Beauty Is Good For You

    The pursuit of beauty is considered by many a reserve of the privileged and inaccessible to people who have bills to…

  • My Coding Process

    My Coding Process

    Performing consistently at a high level is what separates the wheat from chaff in any industry and motivation is an…

    2 条评论
  • Looks Good To Me ??

    Looks Good To Me ??

    Bugs aren't just embarrassing, they are also expensive and the best place to catch them is before they reach…

  • ORMs Considered Harmful

    ORMs Considered Harmful

    Alright, the title is a click bait and ORMs are not harmful. With that out of the way, I am going to make a case…

    4 条评论
  • Slow Is Smooth, Smooth Is Fast

    Slow Is Smooth, Smooth Is Fast

    Move fast and break things was popularised by Facebook and many startups followed suit to their own detriment because…

    7 条评论
  • Commando Go CLI Framework

    Commando Go CLI Framework

    I have been running experiments on the possibility of declaratively defining command groups in Go CLIs and after a lot…

    2 条评论
  • Build a Product From Scratch: User Stories

    Build a Product From Scratch: User Stories

    In the previous article we defined what we are going to build, a CLI client for Microsoft ToDo powered by…

  • Build a Product From Scratch: Problem Definition

    Build a Product From Scratch: Problem Definition

    For new and aspiring programmers, solving a personal problem accelerates learning. Building software systems is an…

  • Expectations Of An Architect

    Expectations Of An Architect

    Let me begin by giving a little disclaimer, I am not an architect, only a student of software architecture and sharing…

  • Think Like An Architect

    Think Like An Architect

    Have you heard about mental models? They are like glasses for the mind, putting one on, will change how you see the…

    4 条评论

社区洞察

其他会员也浏览了