3 ms·
For what it’s worth, this is how I usually go about exploring codebases ( I am the author of that blog post ). I either have something specific in mind that I
by markpapadakis 9y ago
For what it’s worth, this is how I usually go about exploring codebases ( I am the author of that blog post ).
I either have something specific in mind that I want to understand, e.g in the case of Seastar, I wanted to understand their reactor design and implementation, so I locate the respective file(s) that implement them and I start from there, and then I just branch out to other files -- I usually keep multiple vim windows open, and I take notes.
When I am not looking for a specific answer, I choose a directory, and then I sort its files by size (e.g ls -lShr *.{h,cpp,hh,cc,java} ). I usually sort by file size in descending order(smallest first), but some times it makes more sense to sort by largest file first, and I start from there. I still map my way around, and if something stands out, I open the respective file in another vim window/tab, and look it up, and then continue with the previous file.