This article assumes you have just got your new job and you are finding it demanding to settle in and start working on your new team’s codebase. We discuss in this article some of the tricks that can help you familiarize with a new codebase faster.
These tips and tricks are a summary after an intense research and consulting with some field developers in the industry. There’s no magic here, just practical and efficient steps in getting you familiar with a new codebase as fast as possible.
This article will as well help you as a developer to maintain a sane codebase for the next developer that will take on your good work. Let’s jump right in
Here are the five major trips to master a new codebase
- Run the app as an end user
- Dive into the documentation
- Study and ask questions
Run the app as an end user
You should run the live app and look out for app functions, you should scan through the app looking out for possible modules that the code could be divided into. Such modules could be onboarding, chat, home module and so on.
For the frontend devs you want to be looking out for menus, bottom navigation, drawers or any widgets that holds the whole app into one piece.
Some of the time, you will be working on one module at a time so your focus should be on that one module and you could mentally break it down into submodules.
Looking at the image above I can immediately identify some of the major modules of the entire application and I know what modules of the app to look out for when I dive into the codebase and start working on improvements.
Dive into the documentation
Now that you’re done disintegrating the app mentally into separate modules, you want to dive into the code and look out for any form of documentation that exists prior. I personally categorize documentation into low-level documentation and high level documentation.
High-level documentation would refer to the requirement documentation, architecture design and technical documentation.
For the low-level documentation you should look out for some naming conventions, comments and folder arrangement.
The above image displays a typical self-documented folder arrangement and already tells me where to find code for the screens, the state managers, navigation, major app components and even the general app styles.
Study the code and ask questions
The goal here is not to bug down your current team with questions. You have to do a lot of study on the codebase yourself given that there’s a lot of information on the codebase and system you’ll be working on.
The importance of study cannot be overemphasized. A little amount of study can yield to tremendous benefits and help you take initiative on new project ideas, refactoring, improvements on the codebase.
It is advised to only ask questions of crucial relevance in order not to come off as a pain in the ass to your new colleagues/team. I have a colleague that insists that no question is too stupid in programming and I totally agree with him on this.
It is a great quality of a developer not only to ask questions but to ask the questions right that means framing the question in such a way that you get a helpful answer.
In extreme conditions, you might want to rewrite some or all of the codebase that you would be working on. This should be in cases where the codebase is going to cause extra problems for both you and devs that will work on the same codebase in the future.
This could cost your new company a lot of time and effort to achieve and this should be the last resort. Trust me you should discuss real long with your supervisor on the pros and cons of rewriting some or all of the modules of the codebase you’re in charge of.
These tricks can be applied one module at a time and then use the tricks acquired and apply to other modules of the codebase.
It is also of extreme importance for you as a developer to maintain a close to pristine codebase as you can so as not to make another developers’s life a nightmare.
Getting started on a new codebase can be very tricky and difficult for anyone settling into a new team and learning a new codebase but I hope this article helps you make it enjoyable venture trying to familiarize yourself with a new codebase.