Reading Other People's Code

Comfortable to Read Other People's Code

Nov 3, 2024 - 2 minute read

First Step

Please make yourself comfortable to read other people’s code, because it is going to be your daily life as a programmer. Make it as the journey to the wonderful land, and take your time, don’t rush and understand it very well, ask these question : Why They write it that way ? Do they write it with time constraints and pressure ? How would you implement the feature if you are the person who develops this feature ? Is it possible to write the unit test ?

Maybe this sounds ridiculous if I say reading other people’s code is fun, in fact it is harder than to implement something from scratch. Not to mention if the writer is not an experienced one and just rushes to make it work, yup it is the worst and a nightmare.

What to do and solve this problem ? Of course by reading the code.

Steps how to read other’s people code

  • Go to github.com and search for an open source project and read the code and understand it, by understand I mean really understand why it was written that way ?
  • Write unit test
  • Refactoring - for your old project or open source project
  • Read books about programming refactoring. I recommend the book Refactoring - Improving the design of existing code and one of the writers is Martin Fowler.

This skill needs to be developed over time, and this will vary depending on the individual. I am also not consider my self as a good one, because there are sometime I got confused and say what the fuck is this ??. The key point is be patient and write a lot of simple programs with the language that you are working on and you will be surprised when reading other people’s code is fun, and yes this is one of the most crucial skills you need to have in the industry.

final Steps

What are you waiting for anymore ? go and do the steps above :). Hopefully this would give you a little help. Happy Coding.