Question

When it comes to name things like if, else, or return, many developers and a lot of documentation calls it control flow or control flow statements.

https://docs.oracle.com/javase/tutorial/java/nutsandbolts/flow.html

On the other hand, some developers and some documentation calls it flow control and flow control statements respectively.

https://www.ibm.com/support/knowledgecenter/en/SSTFXA_6.3.0/com.ibm.itm.doc_6.3/adminuse/terminal_scriptflowcontrol_tep.htm

And as the third option, some people and some documentation uses the term flow of control and, respectively, flow of control statements.

There was even some arguing on Wikipedia:

https://en.wikipedia.org/wiki/Talk:Control_flow (The last section there.)

Are there any technical or grammatical reasons to prefer one terminology and not others?

  1. control flow / control flow statements
  2. flow control / flow control statements
  3. flow of control / flow of control statements
Was it helpful?

Solution

The word "control" seems to be used in two different senses in these phrases - phrases which nevertheless have identical meanings.

In "flow control", the word control is being used to refer to a statement governing the "flow (of control)". The normal flow is sequential whereas a "flow control statement" is capable of "controlling" (causing non-sequential progression of) the program counter (or instruction pointer).

In "control flow" (or "flow of control"), the word control is used to refer to the statement which is currently "in control of" the processor (i.e. is undergoing execution) - in this sense of the word, the idea that a "control flow statement" governs the flow is only implied.

It would be logically legitimate (although risible and confusing) to fully refer to a "control flow control statement", or a "control of flow of control statement", because in each of these two examples, the word control is being used one time each for each of the two relevant senses. And that concludes the comic relief.

OTHER TIPS

Linguistic arguments aside, "flow control" already means something different in computing. It's used when you have a stream of data and you need to make sure the sender doesn't send it faster than the receiver can handle, as in RS-232.

In other words, "flow control" is about controlling the flow of data and "control flow" is about the flow of CPU control. The terms are confusing, and somewhat interrelated, but we're stuck with them now.

Licensed under: CC-BY-SA with attribution
scroll top