HACKER Q&A
📣 Arisaka1

How can I learn from an existing codebase?


I have the opportunity to learn backend by studying a codebase of an abandoned project. It's a company project, and I asked the devs who made it to make sure that I'm not doing something they don't want me to do.

Problem is, I barely qualify as a backend developer. I'm a junior who was hired as a fullstack and yet haven't touched backend for as long as I'm in this company. The only things I made was following tutorial videos and documentation, which are obviously comparably simple.

Which means I'm excited that I can finally sink my teeth into a real, breathing project to try to extract as much knowledge as I can. From how to structure it, to how they handle middleware, the requirements they had to fulfill, etc.

How can I start growing my skill by doing this, though? I can either a) treat it like a video tutorial and just type the same things they wrote and see how they click, b) try to get the gist on where things go or ask one of the devs who authored it to show me around, but that's company time and I'm sure he has his own workload to do and the last thing I want to be is a burden.

Do you have any recommended way to study and grow your personal skills by reading other people's projects?


  👤 groffee Accepted Answer ✓
First I'd ask why they abandoned it, you don't want to waste your time on garbage.

Second, go to the version control and get the earliest version and code along. Understand each commit, why and what they're doing what choices/trade-offs are being made, read the comments etc.

Then when you can see a function/feature being implemented try to do it yourself first, then go back to the version control and see the differences. This way you'll eventually have your own replica of the projects, and you'll have total ownership and understand every line of code.

You'll also be able to contribute to the new project now that you'll have a proper understanding of what's going on.


👤 karlclement
It's difficult to understand a codebase without understanding who built it. I'd try something like CODEOWNERS.com to generate a CODEOWNERS file and see which GitHub users contributed to each piece of the pie