Keeping Code Maintainable / Readable

One of the reasons why code reviews are done in the first place is to make sure that code is maintainable. Maintainable code should be able to be understood by all developers on the team, not just those with a lot of experience behind them. It can be quite risky if only a small part of the team understands certain parts of the code because of the way it was developed, especially if the team is relatively small.

While there might not be any plans for the junior developer to work on a certain part of the code in the short to medium term, at some point in the future they may be the one working on it so having a wider perspective can only be a good thing. In an ideal world, the developer reviewing the code should be able to not only understand the reasoning behind the changes made, but they should also be able to modify it without spending hours or days trying to figure out why it was implemented in the way that it was.

Senior developers should leverage the fact that new employees (especially junior developers) lack the context they have built up over the years. Reviews from junior developers can help push senior developers to think about problems differently, provide better justification for their decisions and ultimate push them to refine and simplify their implementation to the point that “even a new grad could understand it”. Ultimately, this process yields higher quality and more maintainable code for everyone.