DEV Community

Discussion on: Mistakes I made in code reviews and what I do now

Collapse
 
florianleitgeb profile image
Florian Leitgeb

I do not agree with some things you wrote. You write code for other people to understand. Machines will understand code way easier than humans as long as there are no mistakes in it and if there are, it won't compile and even come to a code review.
Your goal in a code review is, that when you have to add or fix something in half a year, that you understand the code fast and easy. So people write code for other people and when you think that most of your team save time to understand code when it uses a map instead of a for loop, then do it and change this in a code review. People should adapt to teams code styles so that you avoid mental load when reading code from other people on your team because everyone is doing things in a different way.

Collapse
 
amitkumarchauhan1987 profile image
amitkumarchauhan1987

I can't agree more with you....Team must be on same page always...And Code review is one of the ways to do it

Collapse
 
erdo profile image
Eric Donovan

That's fine when there is a clear seniority difference, or when there is an obviously clearer way to write the code. I've usually worked on teams where most people are on a similar level and coding decisions are all about trade-offs / personal preferences. Bringing those types of things into a code review can be a great way to kill the team's dev speed for no obvious benefit