Flow Control

Flow control is the ability to dynamically change the path of execution a program takes. Thus when you start a program you might give it a file name to process. If the file exists it will open the file, if it cannot find the program it might put up a dialog asking you to type in the file name. As well as making a decision about what line of code to run after a decision, flow control means you can branch to an entirely different chunk of code by calling a method, depending on the result of some test.

In addition to simple branching a vital part of flow control is looping, sometimes called “iteration”. Iteration means to repeatedly re-run a piece of code until some condition is satisfied. Although I used the word “looping” describe iteration and many languages support the word “loop” there are several other constructs that support iteration.

There are several standard types of flow control common to most programming languages that only vary in the details of syntax. Thus in the past I have had familiarity with C/C++, Pascal, Visual Basic and now Java and all of those languages have more in common in their flow control statements than they differ.

Last modified: Thursday, 24 July 2014, 2:54 PM