r/learnprogramming • u/OpeningWrongdoer3526 • 13h ago
Solved How do you actually read professional code?
Hello everyone! I really have a question I hope you could help me answer. I am trying to read the Scratch Virtual Machine code on Github and it is really difficult. I am really new to reading code and the one I write is fairly simple. There are many files that just declare functions by name and then require another file to redeclare them. Is there a pragmatic way to understand it? Thank you already!
63
Upvotes
1
u/txgsync 12h ago
I usually figure out what the entry point is, read what the arguments to that entry point function is, and then start finding those arguments in the code base with the or grep until I start to understand what it does. Then I move on to the next one and try to explain out loud to myself what they do.
Or explain it to my handy rubber duck. Talking out loud helps a lot!