As a starting programmer with little industry-experience, I find it frustrating to learn a new project which is based on many technologies that I am not familiar with. The project I am working on has about 150 classes with 15000 lines of code, and with its extensive focus on socket and security programming which I have zero experience in, I am not sure where I should start.
With limited documentation and help at hands, self-study is my best resource in trying to understand this project as a whole. I often find myself spending way too much time learning insignificant features of the product while missing out the crucial classes that I should really be focusing on... The main reason why it takes so much time is that I often have to look into Java API reference every few minutes to understand a small code block... I am sure I will eventually learn it through trial-and-error, but I am sure that there are some useful advices and guidelines I can use :)
Initially, you don't need to understand every line of code.
Borrow a senior developer for a half-hour and ask him to give you the birds-eye view of the architecture - what the major blocks of code are, how they interact, and how the user / usage drives data through the system.
Then spend some time investigating the source for the modules you feel (after the explanation) will give you the best insight into "how it all works".
I have a (probably quite odd) habit of printing out large blocks of sourcecode, and covering a floor with the printouts. Then I can kneel down and crawl around on the floor with a pen and literally draw arrows from point to point, and draw around sections - I find that displaying code in 2D makes it easier to figure things out. It also enables making copious notes that help me understand the flow in more detail.
Before long, you'll start to recognise idioms (stylised ways of doing things) that characterise the code, and eventually you'll find your way into the mindset of the authors. Then everything will be a lot simpler.
While you're on the floor, crawling around, have a laptop+google handy, so you can decipher anything odd you encounter. Also: Coloured highlighter pens FTW.
Make (at least) two passes at understanding the source. The first time don't try to understand any of the minutiae... try to get a feel for "movement" - where data goes, and where execution goes. That will give you a framework for your mental model of the code. When you go through next time, you can start to break down details, but a top-down approach always makes things easier for me.
If you're not familiar with the technologies, language or environment, then do see if there are any books around you can grab. There's a lot more visible space in the real world than you can fit on a computer screen, and having google on a laptop, syntax/library references in a book, and the code all around you makes (for me at least) the whole process VASTLY simpler.
A few things come to mind:
I think, based on the size of the project you mentioned, that this can be a gentle introduction to production code for you. It might seem big now, but 15000 lines of code is on the smaller side of the projects you might eventually work on during the course of your career.
Remember also that this is necessarily going to be a learning experience for you. It's one of your first projects in the industry, so it might take a little while to get used to things. Keep in mind that you're not the first person to have to swim in library / framework soup in an unfamiliar code base.
Good luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With