Whenever I used my trace, I was curious about how the programmers who followed me would react to the comments I d put into the code. Sometimes, to their detriment, they just didn t get it. On one consulting job on Long Island, New York, I inserted the Harkins Trace into a 10,000-statement source program. The trace output helped me understand the actual program execution and then helped me add and implement some significant function for the client.
When I left this client, I turned the program over to another programmer ”an excellent programmer and a good buddy of mine. He saw all my trace statements, and immediately deleted them, no doubt thinking they would get in his way. He then spent the next three days staring at the four-inch-thick compile listing of the program, trying to understand what the program did. I could have shown that to him easily in ten minutes, with the trace output, if only it hadn t been deleted.
Moral of the story: It is virtually impossible for anyone , no matter how intelligent , talented, and experienced , to know what a complex program will do. I am comfortable in that conclusion because the program (actually, its compiled, executable object program) will act very differently depending on the data or other inputs to the program. Anyone ”anyone ”who looks at a complex source program and thinks he knows how it will always execute will be proved wrong at some point ” no doubt sooner than later.
To master a complex program that is fat with thousands of lines of code, you must do three things. First, you must make sure you understand the particular business process (accounts payable, warehouse distribution, etc.) that the program deals with. Second, you must focus only on the key segment of the code that is of interest to you. Third, you must spend the time to put audits into the section of the program that you are working on ” audits that enable you to see the program and data as it executes and learn the effect of your change, for good or ill.
Once you learn that you can easily understand virtually any source program by simply observing it as the object program executes with data, you are the master of most of the programs in your company s vast production program library. The rest is merely repetition and curiosity . Knowing how to audit a long, complex program will turn you into a very valuable , influential, and respected programmer and a desirable prospect for many other companies.