How to digest understand large areas of code?

I’m a self taught programmer and i’ve been programming for a few years now. Almost everything i know i’ve learned with three.js, both by experimenting and reading its source code. I think i’ve made some progress and that i understand how some systems in three.js work.

Some areas are pretty self explanatory and broken down, others can be fairly monolithic.

When it comes to keeping up with three, i like to look at the code in PRs. It seems like a good place to do that since you see both the code and the idea that the author had.

Here too though, i find it easier to read a small diff, than a large one.

For me, up to a 100 lines i can easily read, understand, digest.

I’ve encountered some larger PRs though that i was interested in, but one had over 10k (thousands) of lines. I found it very daunting and time consuming. The ratio between what was removed and added was roughly 50-50 which meant there were 5000 lines of what this code used to do, and then another 5000 for what this code does.

So needless to say, my n00b ass struggled, while other experienced engineers chewed through it… heck, i’d say in a matter of minutes, but i know that must have been a subjective feeling.

Do you have any advice on how to approach this problem?

So far i’ve tried checking out a branch and then using sublime text to navigate the changed files, but it still seems extremely hard.

I’m getting somewhat conflicting information from my job, where the goal is to break up diffs to be as small as possible and three.js github where i was told that i need to ramp up my code comprehension skills if i plan to contribute to the project.

My job is not entirely graphics/3d related though, so i also wonder if i could make this argument there (when doing graphics i.e. - “you have to give me some breathing room”).

1 Like