Four Ways to Avoid Problems Caused by Global Data
December 10, 2008 Ted Holt
Junior J. Programmer modifies an RPG program. His testing works properly. The user’s test works properly. The user approves the change, the modified program is installed, and everything is copasetic until a few months later when the program gets stuck in a loop. What happened, and why is Junior not entirely to blame? Here’s the code Junior added to the program: C 1 DO 5 X 1 0 C EXCEPT PLINE C ENDDO What could go wrong with such simple code? It turns out that the subroutine that contains Junior’s code is also conditionally and indirectly executed from another part |