DEV Community

Discussion on: How Do You Understand a Complex Code Base?

Collapse
 
elmuerte profile image
Michiel Hendriks

Spelunking. A lot of code spelunking. I have been doing that for a lot of years. I like going through other people’s code to understand how they do things. This is why I love open source software.
The best approach to becoming good at spelunking is by starting small in a known environment. Pick a small, well established framework. Set a goal, a thing you want to understand how it is achieved. Then start at the bottom and try to find the path to your goal.

For example. For a small CMS framework. Try to understand what is done to eventually render a page. Or how the plugin/module system ties into it.

Do this once in a while. After a while you become good enough to take on bigger frameworks or more complex goals. Don’t stick to the same framework. Spelunk different code bases.

Eventually you will be good enough to simply dive into large complex systems. You will have developed the skill to know which paths you probably don’t have to take. You know how to keep around relevant contexts.

I’m sure there are articles and books about this. But the best is simply by doing it, often.

Collapse
 
emmanuelobo profile image
Emmanuel Obogbaimhe

That’s good. Currently what I am doing in my project. I just have to accept the fact that it’s going to take time to get a solid grasp of the system. Thanks!