DEV Community

Cover image for Get better at reading open source code
Wassim Ben Jdida
Wassim Ben Jdida

Posted on • Updated on

Get better at reading open source code

This guide is from a personal experience and for me it was so practical, so if you have any other techniques please list them in the comment.

First let me list the main techniques i use to be able to read an open-source project. then i will explain.

1- Techniques

1- Understand what the project do
2- Understand folder names (yep this is the most important one)
3- Your skills in the project's tech stack

Understand what the project do

The first step is understanding what the project is about, why using it, what it's functionalities and what language it uses so you can read the code. this is easy for almost everybody. if you don't know what's the project is about you can't do anything.

for example you want to contribute to kubernetes for someone who is reading now doesn't even know or didn't use kubernetes before and doesn't know how kubernetes is built, won't be able to do anything.

Understand folder names

after understanding what the project is about, you need to understand the project's folder name, this is really so important.
i will give you some folder names and tell you what it may contain.

Folder Description
build,dist Compiled files
src,lib, main source code
test,spec automated tests
tools,utils,helpers Tools and utilities
static,public static files
... ...

golang folder names and meaning

there is a plenty of names sometimes names are meaningful and sometimes it doesn't make sense so just search for name meaning or just ask the developer, and sometimes the developer explains the folder names to make it easy for new contributors.

Your skills in the project's tech stack

last thing is your skills in the project's tech stack, for example you are experienced in ruby and react, but the project is using ruby and vue, you still can contribute but the other porject is using PHP and angular you won't be able to read the code.

after reading this, try to find an open-source project or some project that you are interested in and try to read it using these techniques.

Good luck !

Latest comments (1)

Collapse
 
tokendev18 profile image
Aaron

Nice article man! Thanks for the tips.