Ask HN: What are the ways you go about getting comfortable with a new codebase?

Hacker News - Sat Aug 6 06:57

Ask HN: What are the ways you go about getting comfortable with a new codebase?
9 points by jarusll 1 hour ago | hide | past | favorite | 12 comments
Tools like Eclipse's Java Browsing Perspective(, Visual Studio's Object Browser make it easier to browse the codebase by components.

What are the ways you do it? Is there anything similar available for functional programming?

Fixing bugs.

Someone can explain a code path, what it should do, what the bug is and with that you can get familiar with a path through the application.


Ask around about the big things everyone would like to change and where the scary code is that nobody wants to touch, and with those things in mind, fix some bugs.

The initial questions will tell you what to avoid initially. Longer term, if you can fix them you'll look like a rock star.

Ideally you have someone experienced in the codebase who can give a lay of the land.

I suggest:

1. Find a senior dev, ask then for exisiting pointers to good documentation to self learn.

2. give that a go, make note of all the questions you have

3. then have a session with that dev for platform walk through. Take lots of notes and ask your questions.

4. offer to update docs where you found errata or missing steps or even complete topics not mentioned

5. suggest to the team anything about onboarding that can be improved.

Not using things like go to definition and any fancy tools, just manually forcing myself to work through files to understand how things fit together and using basic tools like grep

Very surprising! IIUC, you consider "Go To Definition"/"Go To References" and other "LSP assists" unhelpful (or worse) when familiarizing yourself with a new codebase. I personally find them indispensable. Could you say more to help me understand your position?

Run it under debugger and go thru whole codebase a few times and you'll start getting proficient at it

I've recently did it on huge, very very specific codebase and after 2-3 months I understood it (what to add where, not just what's happening where) relatively OK

Run the code. This sounds so trivial but it's not always that easy. Once it get's running, I discuss with users of the code (be it customers or developers) and try to understand what they use it for and look for that same functionality in the code. Usually by this point I know where everything is and how to make changes if needed.

Yep, underrated advice. Run it, read the code, fiddle some bits and make sure what you fiddled matches your mental model.

Honestly, learning to read code and execute it in your head is a super power