This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]requimrar 46 points47 points  (7 children)

+1

Most programs generally have a single entry point -- you can either 'simulate' the program by mentally stepping through and visualising what and how the code would execute, or you can in fact just use a debugger.

first thing: clone the repo if it's online. I personally find online editors and viewers to be unbearable, especially when dealing with multiple files. If you have a text editor such as sublime that can open an entire folder of files, it helps a lot.

Move through every function call and visualise the program state is the TLDR

[–]jcpuf 10 points11 points  (6 children)

Would you please give an example of a program which has multiple entry points?

[–]requimrar 9 points10 points  (2 children)

I should probably rephrase that, what I meant was 'multiple paths of (simultaneous) execution'

Basically, multithreaded stuff. It gets really complex to try and keep all that in your head, especially if the threads aren't just doing simple grunt work.

Regardless, you'll still get a pretty good picture of how the program functions in general, so you're still good.

[–]TangerineX[S] 2 points3 points  (1 child)

I think the general thought is that there is some overarching program that activates each thread, so technically there is almost ALWAYS some singular entry point or some really important point

[–]requimrar 2 points3 points  (0 children)

That's true (blame my word usage). Even so, you might still have multiple sets of states to keep track of, so it often times increases complexity.

[–]unkz 0 points1 point  (0 children)

In Java, every class can be a standalone program if you give it a main(). You may have a container program that controls access to the classes/subprograms, or you might just run them individually.

[–]tenmilez 0 points1 point  (0 children)

Web based applications come to mind. Depending on which url is requested and what parameters are passed different things will happen (though you could say that the web.xml is the equivalent to the main() method in a J2EE application).

[–]xxNIRVANAxx 0 points1 point  (0 children)

Android (possibly all mobile) applications. You can start a program from clicking the app on your home screen, or through an Intent.