DEV Community

loading...

How to deal with inherited code!

henryfradley profile image Henry Fradley ・2 min read

I just inherited a codebase for the first time as a student at Hack Reactor and it can be very overwhelming to get started with working with code that was written by someone else. Familiarizing myself with the code was a challenge but it is a necessary skill for surviving in the software development world. Maybe the code is poorly written or maybe its seemingly written way over your head but regardless you have to work with it!
Alt Text

First things first, talk to the previous owner if you can! They clearly know the code better than anyone and if they are still around take advantage of it. First take a look around e very file and understand it as much as you can, and then make a list of specific concise questions. You don't want to bother them too much so try to get all of your possible questions in one session. If the original owner isn't around then it may be best to try to find someone else who worked on the project to lend you a hand.

Regardless of whether you found the original owner or not, spend more time perusing the code and don't move on until you have checked out every file.

Once you have your bearings and think you know the gist of what's going on it is time to install the dependencies, libraries, seed if applicable, and start the server! This is a lot easier said than done but if you can get these steps completed it will make it much easier to see what the code is doing.

Now once you have your environment properly set up it's time to really get to work! Maybe you're just fixing old bugs, maybe you're just adding a new feature, maybe you're completely taking over and refactoring the entire project, or maybe like me you're expanding the back-end to handle millions of requests! Regardless it is time to get to work and improve this project. Inheriting code is a huge part of being a software developer and it just takes practice to become a pro at it.

Discussion

pic
Editor guide