DEV Community

Cover image for Code review best practices
Maxim Nosov ✪
Maxim Nosov ✪

Posted on

4

Code review best practices

Hi everyone,

This week I've been doing some code reviews for Telescope project.

I would love to share some tips for code review that I figured out.

I've reviewed 2 PRs. PR#1 and PR#2.

Don't take it personally

People review the code, not your personality. Project maintainers might be very strict. Hence, they might request changes for almost every line if they see it could be written better.

We have to remember that with code reviews we are just eliminating common mistakes and making ourselves better as developers.

Follow code review checklist

List at least 3 things you need to check in the code. For example, it could be the following:

  • Security

  • Reusability (e.g. can we reuse the written functions)

  • Code simplicity

Multiple reviewers

Code review is a team work, meaning it's better when multiple people review a little piece of code.

It will help to stay focused and not feel overwhelmed. As a beginner, If you review only 50 lines of code, it will be much easier comparing to reviewing 1000 lines of code, where at some point, you might lose concentration. Programmers are humans, not robots :)

Leave proper comments

In the comments, **leave clear and concise comments **about what should be changed and why it's a best practice.

Automate code styling

We need to use automation for repetitive tasks as much as we can. Use prettier and linter to make sure that code is easy to read.

If you enjoy blogs, you could buy me a coffee. It will motivate to write better blogs :)

What else do you think could be considered as code review best practice ? Let me know in the comments :)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

While many AI coding tools operate as simple command-response systems, Qodo Gen 1.0 represents the next generation: autonomous, multi-step problem-solving agents that work alongside you.

Read full post →

Top comments (0)

The best way to debug slow web pages cover image

The best way to debug slow web pages

Tools like Page Speed Insights and Google Lighthouse are great for providing advice for front end performance issues. But what these tools can’t do, is evaluate performance across your entire stack of distributed services and applications.

Watch video

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay