Profile picture

Code Review Q&A and Videos

About Code Review

Code review is one of the most common and powerful ways for software engineers to learn. On top of increasing code quality, it builds engineering culture within a team.

How to deal with a boss who is very nitpicky in code reviews?

Software Engineer at Early-stage startup profile pic
Software Engineer at Early-stage startup

My direct supervisor/ tech lead has a tendency to leave a lot of nitpick comments on my and my teammate's PRs during code reviews. I know the intention is positive, but in my view it's excessive and leads our team to spend too much time addressing stylistic or minor changes that don't materially improve the codebase. Since we're building for an early-stage startup I also believe it's a higher priority to ship code that works well enough so the business can get customer feedback, rather than focus on subjective stylistic things. It also increases the noise level in every PR and makes it hard to identify and focus on any comments about significant things.

I raised these concerns directly with my supervisor and also asked for clarification about which nitpicks are actually optional or if I can opt out of implementing any. My supervisor said I need to address/respond to every single nitpick comment, which means if I disagree or don't want to implement the nit, I would have to explain why every single time, which I think is not an efficient use of time. They also said we don't have to implement everything they suggest, and they welcome pushback, but I don't think they realize it feels a bit harder to do that when they leave so many nits and they are in a position of authority and are not my peer. I shared a suggestion that we make it ok for the PR owner to opt out of addressing a nitpick / leave it up to them to decide, and also try not to focus continually on stylistic things that can't be automated by linting etc. This was ignored though.

Does anyone have any advice on how to handle this situation? It's very frustrating and exhausting sometimes, and part of me has tended to cave in and just implement every bit unless I have a really strong opinion against it for the sake of avoiding spending time debating too much. I'd like to be wise about picking my battles.

Show more
Posted 7 months ago
136 Views
6 Comments

What systems can I put in place so I make fewer dumb/obvious mistakes?

Entry-Level Software Engineer at Taro Community profile pic
Entry-Level Software Engineer at Taro Community

Basically, I feel like I have so many unnecessary ‘DUH! I can’t believe I missed that!’ moments in public -- mainly when asking for help and creating PR's.

For example, I recently was so focused on the more difficult part of a ticket, thinking about edge cases and trying to really polish this bit of functionality, that I spaced on reviewing the ticket before creating a PR. This meant the lead engineer reviewing my PR had to explain to me that I missed some other aspects of the ticket.

Another time, I spent a while trying to right a really good question about a solution to what I suspected was a tough issue. The problem? I hadn’t thought to test my hypothesis and confirm that this issue would occur (it didn’t) before formulating and asking my question. So I needn’t have bothered anyone else or myself about navigating this hypothetical problem.

When this happens, it makes me feel like my work isn’t thorough or to a high standard, not mention making me look bad. So it’s something I’d really like to improve, but it seems when I focus on being thorough it perpetuates the problem like in the two examples above.

I feel like I need some checklists/processes as guardrails for common scenarios (e.g., creating PR’s, asking for help) I can fall back on, because otherwise I feel my brain will keep missing things and making easily preventable mistakes.

Show more
Posted 8 months ago
121 Views
4 Comments

Learn About Code Review

Code review is a fundamental part of software engineering. It is a process where engineers review each other’s code to improve its quality and receive feedback. Code review gives your teammates the ability to look at your code closely and catch potential mistakes and bugs early on. This can help stop small issues from turning into larger issues later on. Code review also increases awareness of what teams are working on, encourages cross-pollination between teams, and facilitates discussions about coding standards.
Code review allows you to share knowledge with your team about industry and team best practices. You can uplevel each others’ skills by offering feedback on how to make each others’ code better. You can ensure consistency of code by ensuring contributions to the code base follow the same patterns. When the codebase follows the same patterns, it’s easier to understand, maintain, and grow a project.
There are clear guidelines you can follow to improve your code review process. You should set clear goals for code review by specifying what you want to achieve, usually maintaining high code quality, sharing knowledge, and making sure everyone uses consistent coding patterns. This will set the stage for a focused code review. Give feedback that will improve your teammates’ coding ability instead of just pointing out problems. You should always provide suggestions on how to fix the problems. You can make the code review process smoother by using tools that automatically check for common issues, like code style. These automated tools can catch problems that can be missed in a manual review.
There are some common mistakes and traps that people follow into during code review. You don’t want to focus too much on the nitpicky code style. You should have a discussion once about code style, then you should automate it away which will lead to consistent enforcement of the rule and save your team time so they don’t need to constantly look for code style mistakes.
Pay attention how you give feedback because code reviews involve people. You should be positive and considerate when reviewing other people’s code. Recognize the effort put into the code and create an atmosphere where everyone feels encouraged to work together.
As the code author, you should develop a sense of empathy for the person that is reviewing your code. This means making the review process as smooth as possible for them and being grateful for the time they spend reviewing your code. This can mean adding context in your pull requests and including before and after screenshots.
Remember that code review can have many benefits in software engineering. It helps to keep code quality high, encourages teamwork, and it makes sure that everyone follows the same patterns. Software engineers can use code review to boost the overall success of their development efforts.
Show more