What I find to be maybe the single most important part of code review is knowledge transfer. Our entire small team thumbs up a PR before it's merged unless there's a big rush on it, and this gives everyone on the team a rough idea of the state of the codebase at any given time. There's no being blindsided like "this whole system I depend on is gone" like I had happen at far more siloed places I've worked. Beyond that…
The primary purpose of code review is to find code that will be hard to maintain
21–30 of 193 posts
Re: The primary purpose of code review is to find code that will be hard to maintain
#22This is why the solutions for high-trust environments (small teams) and low-trust environments (big companies, open source projects) will be different.
Re: The primary purpose of code review is to find code that will be hard to maintain
#23Re: The primary purpose of code review is to find code that will be hard to maintain
#24Earlier quoted context omitted.
If the code is so smart that it's not easily understandable, it's not easily fixable. My transition from junior to senior was accompanied by the realization that simpler is nearly always better.
Write me simple AI inference code that has high performance in big batches.
Who is getting called at 2 AM when something breaks? Not the junior.
Re: The primary purpose of code review is to find code that will be hard to maintain
#25Re: The primary purpose of code review is to find code that will be hard to maintain
#26You're not reviewing the code to confirm that the code is bug free... you're reviewing the additional code that confirms that the feature-code is bug free.
Any process that has a step of "we'll get to that later" is a failure. That includes testing. Until there is some provided content that will be able to provide evidence that that code is safe to merge, it's not done.
But yeah, I need to be able to understand what every line does.
Re: The primary purpose of code review is to find code that will be hard to maintain
#27Earlier quoted context omitted.
If the code is so smart that it's not easily understandable, it's not easily fixable. My transition from junior to senior was accompanied by the realization that simpler is nearly always better.
Write me simple AI inference code that has high performance in big batches.
Re: The primary purpose of code review is to find code that will be hard to maintain
#28The primary purpose of code review is to maintain existing hierarchy by preventing junior SWEs from getting promoted by committing code that is smarter than what the senior architect can understand.
If the code is so smart that it's not easily understandable, it's not easily fixable. My transition from junior to senior was accompanied by the realization that simpler is nearly always better.
Bad programmers make the simplest things really complicated.
Re: The primary purpose of code review is to find code that will be hard to maintain
#29Re: The primary purpose of code review is to find code that will be hard to maintain
#30Uh.. why not both?
The way to confirm that code does not have bugs is testing. So the reviewer is not looking at the code saying "this will work", they're looking at the code saying "I understand how this works, it makes sense."
Evidence that the code is safe is something that also should be provided in the PR, but it is not the main code. It is ideally test automation that is just as understandable as the feature code, but failing that ad-hoc test evidence or a specific step-by-step plan with evidence of execution is good too.