How to understand a big codebase???
Tags: github, opensource, codebase, tips
Published: 2023-04-02 11:56:32

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rknfktqgz40axsut88p3.png
title: How to understand a big codebase???
published: true
date: 2023-03-28 17:34:27 UTC
tags: github, opensource, codebase, tips
canonical_url: 
---

Open source is taking over the world! You want to start contributing as well but get stuck because of one hurdle. The dreaded **CODEBASE 😱.** Yes, it's a nightmare when you feel like you need to go through hundreds of files and folders just to make a small contribution. But I will break some myths here regarding it and I hope with this article you never have to fear a big codebase ever again.

![gif](https://media.giphy.com/media/29HR25LAyA4yoEik96/giphy.gif)

But first, let's create a scenario:

1. You are familiar with the project's goal.

2. You have used it yourself.

3. You know the tech stack used in the project, at least partially.

4. You got assigned an issue to work with.

5. You want to raise a PR soon so you start looking into the codebase...

Let's take the [LinkFree](https://github.com/EddieHubCommunity/LinkFree) project by [EddieHubCommunity](https://github.com/EddieHubCommunity) as an example.

* * *

## The right approach ✅

### 1️⃣ You don't have to understand each line of code ⛔

If you're looking to contribute to a project, it's common to feel overwhelmed by the codebase. However, you don't need to understand every single line of code to make meaningful contributions.

Focusing solely on the code relevant to the issue you're trying to solve will save you time and energy. Trying to understand everything can be demotivating and may deter you from contributing altogether.

Additionally, it's important to keep in mind that there may be other technologies at play in the project that you're not familiar with, making it even more challenging to understand every line of code.

![readme](https://cdn.hashnode.com/res/hashnode/image/upload/v1680023320797/fe17c5b9-2348-4b7b-94f8-f28a2e386270.png)

### 2️⃣ Look at the codebase from a broader aspect 🌲

Understanding the structure of a project is crucial, even if you are not familiar with every line of code. A broad overview of the project's architecture can help you comprehend how its components are connected and functioning in unison. With this understanding, you can make changes to the codebase wisely and promptly fix errors while anticipating how other areas of the application will be affected.

In the below example for the LinkFree project, you can see that the source code is well-structured and thus helps us to understand which file is in which directory so that while making any code changes we can find the source easily. It creates a clear picture of the project's architecture in our heads.

![codebase](https://cdn.hashnode.com/res/hashnode/image/upload/v1680020061841/dcb895a1-a8be-4940-946b-95d830014bb5.png)

### 3️⃣ Don't ignore the docs 📄

If you're looking to gain valuable insights into a project's structure and key functionalities without having to do everything yourself, then reading the documentation can be incredibly useful. This approach is widely followed by many people. By taking the time to carefully read through the project's documentation, you can gain a deeper understanding of its inner workings and potentially save yourself a lot of time and effort. So, whether you're a seasoned developer or just starting, be sure not to overlook the importance of properly reviewing project documentation.

### 4️⃣ Ask, don't assume ⁉

If you're grappling with complex coding issues and feel clueless about how everything works, don't hesitate to seek help from the maintainers or fellow contributors. Not only does it save time, but it also enhances your understanding of the code. It's best to avoid making assumptions and reaching conclusions on your own, as this can lead to significant problems. Reaching out to experienced individuals can not only help you solve the issue at hand, but it can also give you valuable insights into how to tackle similar problems in the future. Therefore, asking for assistance when needed is a wise and beneficial move.

[see this example](https://github.com/EddieHubCommunity/LinkFree/discussions/2179)

### 5️⃣ Think less, do more! 💻

To gain a deeper understanding of a complex codebase, it is crucial to play around with the code as much as possible. Breaking the code and analyzing the impact of each line on the application is the best way to learn. Through this hands-on approach, you can gradually become more familiar with the system and make valuable contributions to the project. Start experimenting today and enhance your knowledge of software development. **This is truly the best way to understand a big codebase**.

* * *

Now keeping all the above points in mind you can start looking into the codebase with much more confidence and can find the source of errors in the code with much ease.

![gif](https://media.giphy.com/media/mODxI0z4HGpZS/giphy.gif)

I hope with this article your unreasonable fear of the codebase went away since there is nothing to worry about. You can start contributing today to your favorite project and can embark on your open-source journey. Happy coding :) 💗