DEV Community

Discussion on: The Distressed Code Review

Collapse
 
aminmansuri profile image
hidden_dude

Good code reviews can be effective if there's a "wise architect" that can help guide the team (or several of them).

I know this sounds a bit hierarchical but often times you have people that are new in a project and people who have been there for a while. You also have different levels of skill and experience.

When new on a project, I always want to hear what others say about my code because it's a big learning moment about the architectural decisions that predate me.

However, as time goes by some bad practices can come to light and when the group talks about how to tackle them the code reviews can then help remind people to take care of them in the future.

I agree that nitpicking can be a waste of time. Nobody is ever going to write code nicely but some ideas like:

  • Are things named well? (ie. can other people understand what your code does)
  • Is error handling and logging thorough and consistent according to the current project's best practices?
  • Are there any glaring security holes?
  • Does the code have any chance of solving the problem at hand?

That last one is the most important in my mind. I've reviewed code where the approach taken simply will never work. No sense in even testing it. Make sure the right algorithms are used, that memory is used wisely, that there aren't any glaring bad hacks.

It does help if there's a more senior person setting the tone of things or otherwise the project can go in all directions.