top | item 19950458

Ask HN: How to learn a large code base quickly

2 points| bitn0mad | 6 years ago

Hi -

I have joined a team with a large code base (written in Java) that I am trying to ramp up quickly on. I am able to navigate using the IDE and do the small bug fixes. However, I feel that I am unable to see the architecture completely to provide valuable input in design discussions.

Any tips on learning a large code base quickly?

Thank you!

2 comments

order

greenyoda|6 years ago

Some suggestions:

- First, and maybe most important: familiarize yourself with the general functioning of the product from the user level. The code will make much more sense if you understand what it's actually supposed to be doing. Also, many of the class and method names reflect things that the product does, so understanding the product will help you decipher the code.

- Try to understand the high-level architecture, e.g., what are the major parts of the system and how do they talk to each other? Looking at how the product is built and deployed could help identify the major pieces. In Java, these pieces might correspond to jar files. If the product stores data in a database, what are the main database tables? If it's a web app, what are the servlets or other APIs that the GUI uses to talk to the back-end?

- If the product has Javadoc documentation, use that to get an overview of what the various parts of the code do. Try to find any other documentation that exists about the implementation of the system. (Unfortunately, sometimes there's no doc.)

- If there are people on the team who are willing to give you an overview of the code, spend some time talking with them.

- Once you've done all of the above, sit down with the debugger and try to trace the sequence of events that occurs when you perform some simple user operation, like clicking on a button in a GUI. Try to predict in advance what might happen based on your understanding of the architecture. Read through some of the code that you've executed to get a more detailed idea of how it works. Repeat many times with different types of operations.

While doing all this, write down detailed notes. These notes will be useful for you to refer back to, and could also help the next new developer understand the code more quickly.

arthurcolle|6 years ago

There may be language specific advice, but honestly, you have to go through the entire thing and learn every single line. Most people are okay with just absorbing every little piece they can when they get assigned specific tickets associated with the sprints they are working on, but to really learn the apparatus you have to just learn how the whole thing works.

Of course starting at serializers and then going to routing, etc may seem very bad from a learning-organizational POV, but that's what you have to do to learn the entire application stack.

Is this a web app? Maybe there's better advice depending on the specific piece of software in question but at the end of the day you have to master the paradigm before being able to contribute in a meaningful way.