![]() |
|
[Java] How to start understanding large code projects? - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Java] How to start understanding large code projects? (/showthread.php?tid=5946714) |
How to start understanding large code projects? - severos - Mar 2, 2019 Kinda silly question, but I have to understand the code of Neo4j which is mainly Java. It's first time having to read such very large legacy code, so I'm kinda lost on where to start from. Anyone got tips or ideas on how to start this? RE: How to start understanding large code projects? - lockhead - Mar 3, 2019 Depends on what your goal is. If you want to understand the whole program then you probably need to read the whole program, or you just pick out the parts you're interested in. As for the approach I'd start at the main function and work forward from there. Try to find the important classes and components make yourself familiar with them first and skip over helper/util/parser etc classes. Once you understand what the key parts/classes of a program do you don't need to understand every line, just what they do and roughly how it's done. Also it's like everything else in life: the more you do it, the better you become at it. Good luck RE: How to start understanding large code projects? - +Haze - Mar 3, 2019 I have been coding for ages and I struggle with reading other peoples code. When the program is small, it's alright, but when there's many lines of code, it quickly becomes frustrating to understand what they're doing. That's why I find it weird when people recommend contributing to open source projects, most of the times, you're not going to have the same approach, programming style and knowledge as the author, so that potential gap can lead to a mess. This is why documentation is very handy, if there's documentation on how the system works from an architectural point of view then it helps a lot. RE: How to start understanding large code projects? - pointandlaugh - Mar 4, 2019 One thing I've always done is to start pawing through the unit tests if I hit a function I don't understand. Most larger projects will have pretty well maintained tests, and if you have a good IDE you can just click through and look at what's being called. You can also use a debugger set breakpoints in them and see what's actually be passed and how without needing to figure out how to make the executable do it |