Re: How to decipher a large program.



Chad wrote:
I recently downloaded a program that inserts captions in .jpeg files.
However, I'm sort of at a loss on where to start to see how it
works.The program has 3 c files and 4 header files. In the header
files, the
person comments on what function is supposed to do.

The question is, how do I figure out how each of these functions
interact with each other? Do I just get
a pen/paper and start jotting down notes? I was maybe thinking of
constructing some kind of flow
diagram to see how these functions interact. Any ideas?

Use tools: load the program in an IDE or an editor supporting tags, run grep to locate comments relevant to what you're looking for, trace the library or system calls the program makes, or use a profiler to create dynamic flow graphs. http://www.spinellis.gr/ismr/tools/index.htm

In most cases you're not interested in how the complete program works, so try to focus early on by searching the code for files, comments, strings, or identifiers that match the functionality that interests you.

Incidentally, the program you describe is small not large. Developers routinely maintain and fix multi-million large systems.

--
Diomidis Spinellis
Code Quality: The Open Source Perspective (Addison-Wesley 2006)
http://www.spinellis.gr/codequality
.



Relevant Pages

  • How to decipher a large program.
    ... I'm sort of at a loss on where to start to see how it ... works.The program has 3 c files and 4 header files. ... diagram to see how these functions interact. ...
    (comp.programming)
  • Re: How to decipher a large program.
    ... I'm sort of at a loss on where to start to see how it ... works.The program has 3 c files and 4 header files. ... diagram to see how these functions interact. ...
    (comp.programming)