DEV Community

Cover image for Getting started with a project written by another developer

Getting started with a project written by another developer

Tawanda Nyahuye on July 09, 2021

Lets get into this I have been there and if you are not a newbie, you have probably been there but if you haven't been there, don't worr...
Collapse
 
lavenderzandile profile image
Lavender Tshuma

Very helpful. I just completed my first month of my internship... I struggled with tasks at first because I tried to solve what I did not quite understand... Until I decided to learn the language then tackle the task. It's been better ever since I used this approach

Collapse
 
codewithfortune profile image
Fortune the Dev πŸš€β€οΈ

Exactly bro

Collapse
 
towernter profile image
Tawanda Nyahuye

Thank you, im glad the approach is working well for you. All the best on your internship.

Collapse
 
ferbs profile image
Jeff Ferber

Using and/or adding automated tests is the most productive thing you can do. If there are no tests yet (an unfortunately common case) adding the first might be an expensive initial investment but generally proves out to be the best possible use of time.

Also, rather than reading the code as text, interact with it using a debugger. Configuring a debugger in your IDE isn't pleasant but usually not too hard if the src runs on your local system. (It can get painful if running remotely or in a Docker container but even so worth a try, look for articles.)

Collapse
 
rhymes profile image
rhymes

I always start from tests and putting breakpoints in random places and see how i can hit them :)

Collapse
 
ferbs profile image
Jeff Ferber

Nice. It's weird but setting up an IDE's debugger seems to have exceptionally high mental activation energy. Am guilty myself--didn't touch it for years. And when my wife started learning to code, she wasn't shy about telling me where to shove my debugger. :) For non-html projects, I've noticed too that only a small portion of even fairly senior coders set it up.

Collapse
 
bartjaskulski profile image
Bartek Jaskulski

Additionally, I would advise to run the test suites if there are any in the project. And run them often, especially when you are messing around with the code when you are getting familiar with it.

And remember to take your time. You don't have to comprehend the whole codebase at once. Learn it bit by bit.

Collapse
 
rafarel profile image
Rafarel • Edited

I've just inherited a Symfony 2 project where 3 dev worked on it before me. It is a monolithic project with absolute no concern about architecture, I have 1Ok+ repository class that does all sort of things, even sending emails. The average function is 500 lines. I have no choice but to work upon this spaghetti code base because I'm hired to add features to the website (to respond to business needs) and not do any architecture or cleaning. I assure you the task is very hard, you can't test anything at all, you investigate code that simply can't run, with no code style at all and a database with messy data that sounds very corrupted to me. Have you a good psychologist to recommend ? ^^ Have you encountered this kind of situation ? What would you do / react to ?

Collapse
 
creativezoller profile image
Zoller

As a mentor I used to suggest the same methods for junior devs, so they can easily catch up with other developers code structures, ways of thinking, human logic behind everything and the number of cups of coffees they drank while doing these codes :) Seriously this is like #1 of a Jr. Developer 101 list. Unfrotunately lot of people do not get this, especially when they are not motivated for knowledge and self-improvement but propelled by 'getting tons of money'... Keep it up, these writings helps junior devs to start thinking like pros :)

Collapse
 
fewwy profile image
Fewwy

I was doing that for the last 3-4 months of my internship. The difficult part is that I have 3 projects to support and I'm jumping between them.
Of course they were written by the different people with different JS stacks :D

Collapse
 
ludamillion profile image
Luke Inglis

Sound advice. I’d love to see, or maybe I’ll write, a post of how to make it so that your project is easy to get started with for another developer

Collapse
 
towernter profile image
Tawanda Nyahuye

Good idea, you should write about that

Collapse
 
realquadrant profile image
timfong888

I am interested in coming up with a standard practice of understanding someone’s code. I came across a very short article and would like to get feedback from others.

Collapse
 
tinashediego profile image
Winner Tinashe Diego

Well said