Reading is Fundamental

Diana Liu
Diana Liu
Aug 18, 2016 · 3 min read

Pull requests and code reviews are a pretty established practice across modern engineering teams. There are tons of great resources on the what, the why, and the how of code review.

And yet, it can be really hard to build a culture around code review. Developers don’t value it because it’s hard work, it’s work to benefit another person, and it’s time that you’re not writing code.

Code review forces you to read a lot of code. As programmers, we value writing code a lot. But reading code is just as fundamental a skill that is often overlooked.

Many people have written about how to read code. I’d like to share why we should read code and do more code reviews!

1. You can’t write All of the Code!

No matter how long you keep at it, you will never be able to write all of the code :) Reading code, via code reviews, increases your exposure to code. This is good. This is how you get that fabled “experience”.

2. You read more code than you write, so you might as well get good at it!

Code is read more often than it is written. Over the course of your career, you will read far more code than you will ever write. Learning the ability to navigate an unfamiliar codebase and situate yourself and be able to reason critically about that code is an evergreen skill.

3. You gain insight into what makes code maintainable

Programmers aspire to write code that is clear and maintainable. Unfortunately, the feedback loop for your own code can be very long. You may never touch that piece of code again. Or, it may be many months or years before you need to modify it again and that is when you finally see if the past decisions you made have panned out.

When you perform a code review, you can immediately see the feedback on all of these things!

  • You are reading somebody else’s code, so you have the distance and perspective to evaluate if it’s clear or not. You will need more than a gut feeling to explain your reasoning to another human being. This makes you conscious of what makes code understandable and you can take that back to your own work.
  • When you are looking at a diff for a pull request, you can see both what the old code looked like and what the new code looks like. You can see how much the person had to change to make it work. Did they have to shoehorn something in? Were they able to re-use existing code/concepts?

Reading code productively takes a lot of discipline and practice. It requires you to be introspective and empathetic. These are valuable skills to work on and will make you a better programmer and a better team member. That’s worth it!

Diana Liu is a Tech Lead on the Product Engineering team.

Want to read my code? We’re hiring!

In the Weeds

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store