Skip to main content

Why Spend Time Reading Other People's Code?

Updated 3 min readMarkdown
Part of seriesThe Odin Project notes
Why Spend Time Reading Other People's Code?

I initially wrote this as a sidenote, part of the first article in this series, but it felt like something that could stand on its own. It's a brief article justifying, from a subjective point of view, the usefulness of reading other people's code.

Let's dive in!

Reason 1

It's like a shortcut to discovering new things you can do with, in my case, Ruby. It's through reading others' code that I found out about some methods, like: Object#freeze, Array#take, Array#repeated_permutation, etc.

Sure, I could've found out about them from the docs, but I didn't, so...

Reason 2

It reminds you (or shows you examples) of some things you've learnt/seen but didn't use/haven't used. A lot of things can lead to you not using some of the things you've learned:

  1. Maybe you just forgot about it while working on my project, or
  2. You remember the thing, but you just didn't see its utility in your work, or
  3. You don't fully grasp the thing or the concept behind the thing (due to knowledge gaps and whatnot), and so you choose to spend your energy on working around the thing rather than figuring it out at that time.

No matter the case, if you go through enough submissions, you'll find someone that used something you didn't — but that you were both exposed to — to accomplish the same goal. A few of those times, the thing they used will fit into one of the categories above. And that always pays off. How so? Well...

  1. You get a free reminder of the thing (tool/method/concept/whatever) AND a practical use case.
  2. You get a good look at what an implementation that uses that thing looks like so you can make comparisons with the way you went or just note it as something to try out yourself another time.
  3. You see how someone else used that thing, and that helps you learn.
  4. BONUS: You can see room for adapting the thing to your own work (if you want) or for improvements in the person's work and the way they used the thing. Which is part of what open source is all about, no? And open-source contribution is definitely on the list of things to do in my life.

Reason 3

It prepares you for the job. I've seen lots of blogs about how a lot of the time², dev jobs involve more reading someone else's code than writing your own code. I assume that's WAY more apparent now that most of the code written these days is written by AI worldwide. The ability to read code seems, to me at least, fundamental to understanding code well enough to make judgements about it when it is erroneous or misaligned with conventions, team goals, or business goals.

Reason 0

I'm going to be honest, I didn't really do "reading other people's code" at first. It seemed like something that could be important*-ish* but not as important as developing my own code-writing and building skills. The first thing that really made me think, "Okay, this might be worth the effort," was the fact that the brilliant people who maintain the The Odin Project's curriculum and Discord community said so. That's it. The original motivation, plain and simple. 🙂

About the author

  • I'm a Computer Science graduate and Full-Stack Developer in training. I'm trying to come out of my bubble by sharing what I'm learning—documenting my journey into software development through builds, confusion, and reflection.

No comments yet. Be the first to comment.