In my work we have a very chaotic django code base that's hard to understand. Any tips on how to learn the code base?
For further actions, you may consider blocking this person and/or reporting abuse
In my work we have a very chaotic django code base that's hard to understand. Any tips on how to learn the code base?
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (2)
Take notes, create your own map of the project. You can do it by hand or possibly use some software to show the dependency graph. By leveraging visualizations of which files import other files you will see some files/classes stand out in importance.
Make sure your Python fundamentals are strong. If there is unfamiliar syntax then look it up. If the classes use complicated inheritance schemes then try drawing a UML diagram of the classes to help make sense of the relationships.
Look at the tests if they exist. The test cases should help explain what the code does.
If you're lucky enough there might be MyPy type annotations. You can read these and think about the range of all possible values that satisfied those types. If the project doesn't have them, consider learning about types and adding the annotations yourself.
There used to be a package for Django that would visualize the database tables and their relations using the Django models. Try to use that to understand the database. Really focus on the models anyway they are usually the center of a Django code base anyway.
When you are writing notes try not to get bogged down in describing what the code does, but rather to try to figure out what is the intention behind the code. What is the code for? Why does it do things the way that it does? What are the constraints on the system?
Hi, I’m actually having a hard time switching between different projects at work. Right now, I’ve been assigned to a new project that I’m not very familiar with, and I’m struggling to know where to start.
The main problem is that whenever I try to understand one function, I find that it depends on another function. Then that one depends on something else, so it feels like an endless loop.
I work on a Spring Boot project, and I do have functional requirement documentation from the Business Analyst, but I’m still not sure how to approach the codebase efficiently.
Do you have any tips on how to decide what I really need to understand for a task and what I can ignore for now?