Blogmark

How to Understand a New Codebase Quickly

via jbranchaud@gmail.com

https://avdi.codes/how-to-understand-a-new-codebase-quickly/
Software Development

The best way I know to get acquainted with an unknown codebase is to fire it up locally (this alone may be very hard). Then approach softly, humbly, as a mere user. Start making theories about how it works, and what parts of the code are responsible for the behaviors you see.

This not only might be tricky to do, but you'll have to do it eventually anyway. You'll probably encounter several steps that are missing or aren't quite right. You can help with updating the docs where this setup slippage has occurred.

Then deliberately start breaking it.

This is a great idea. Make theories about what executes and how it executes. Then put it to the test with a little raise 'hell' here and there.

As you're approaching the app from the perspective of a user, think about the different kinds of users of the app and the unique workflows of each of those users. Also, are there important execution flows through the codebase that no user experiences or triggers, but instead are part of an external/automated process? Those flows can be hard to find and can be some of the most essential business logic.