r/learnprogramming • • 17d ago

Developers often struggle with unfamiliar GitHub projects

Hey there, I have run into this problem a few times. I'd clone/fork a GitHub repository that had something useful for me, but the project structure was often so confusing that I couldn't figure out what anything did or where to start. Most of the time, I'd just give up on it. I was wondering if any of you have experienced the same thing and how do you usually deal with it? Do you use any specific tools, or do you just explore the codebase manually?

17 Upvotes

13 comments sorted by

View all comments

2

u/pixel293 17d ago

When I'm looking at new projects it's because I'm fixing a bug, updating a feature, or adding a feature. In the bug case, I'm not focusing on the whole project, just the function that either has the bug or the function(s) that call the function with the bug, I ignore everything else. Same basic idea with a updating a feature, I'm only focusing on the functions/structs related to that feature. Adding a feature means looking at the another feature that is close or does some of the same stuff, and just understanding how that feature is implemented, so I can implement the new feature.

Do this enough times with a project and you start understanding the whole project. So really it's just constraining your scope, only focus on what you need to focus on to achieve your goal. Don't try to understand the whole project, that will come with time. Also don't under estimate the benefit of stepping through code as it is running and sometimes looking at the call stack can give you a very clear idea of the path the code takes.