Diving into a large codebase

As a developer, there are several scenarios where you might need to jump into a codebase and find your way around. I want to share a few strategies that have I have found helpful over the years.

Documentation

Most of the time, if it's an old legacy code base documentation would be severely lacking or almost non existent. If this is the case, try to document whatever you manage to grasp and contribute back to the project. This might be useful to somebody else or your future self. If only more people, especially those in management, understood the value of documentation.

Up and Running

I find it useful to get the project up and running locally. This helps you quickly test your assumptions about the code base. If this is not properly documented, its best to take help from a colleague or somebody else with more experience. Nobody will expect you to figure this out yourself.

Dipping your toes

Although it can be tempting, spending time to figure out how the whole project works may not be a good idea and can take more time than you anticipate. If you are working on something specific, reduce the scope and focus exclusively on the parts that you are interested in.

One step at a time

Once you have identified the area you are going to focus on, then you can delve deep to learn more. Strategic debug points can go a long way here compared to using log statements. The debugger call stack also helps with understanding the code flow.

Give it time

Don't be hard on yourself if it takes some time to understand a new codebase. Take a break or even better, sleep on it.

Arjun Sajeev © 2020