Hi I am a bit new to programming and recently I have been given a piece of code that I must understand of a monopoly game written in Java.
I have never tried to understand someone else’s code so naturally I don’t even know where to start.
My boss asked me after I understand the code and it’s functionality to reproduce it.Easier said than done since the game has about 3000 lines of code.
I have tried to start from the main class but this seems to be getting me nowhere because I keep being sent to a dozen different classes.
What I wanted to ask is if there is a software that shows what pieces of code are running during the time the game is turned on.
If such software doesn’t exist, where in the code do you guys recommend me to start and what tips can you give me to make this go well?
Just read the code. 3000 lines is really few. Read from top down, if there is a foreign class, CTRL+click on it, then read it too from top to down, then click ALT+LEFT, which takes you back to the previous (main) class.
Or you can create UML diagrams in (for example) NetBeans.
Or debug your code step-by-step to see where it runs.
(But it bugs me… How come you have a boss – hence a job – as a programmer if you don’t know what a debugger is?)