![]() | Control flow was a good articles nominee, but did not meet the good article criteria at the time. There may be suggestions below for improving the article. Once these issues have been addressed, the article can be renominated. Editors may also seek a reassessment of the decision if they believe there was a mistake. | |||||||||
|
![]() | This ![]() It is of interest to the following WikiProjects: | |||||||||||||||||||||||||||
|
![]() | This article contains broken links to one or more target anchors:
The anchors may have been removed, renamed, or are no longer valid. Please fix them by following the link above, checking the page history of the target pages, or updating the links. Remove this template after the problem is fixed | Report an error |
First paragraph has " an imperative or a declarative program ". Can the words imperative and declarative be omitted since we're not actually singling out one kind of program? 74.14.226.215 (talk) 14:02, 23 October 2014 (UTC)
Declarative programming definition in Wikipedia says: "In computer science, declarative programming is a programming paradigm, a style of building the structure and elements of computer programs, that expresses the logic of a computation without describing its control flow.". However in this article we see that control flow can be described for declarative as well. This is confusing. — Preceding unsigned comment added by 88.119.150.196 (talk) 07:56, 8 April 2015 (UTC)
From Murray Langton:
Nobody commented on my outline for a complete rewrite, so I have done the rewrite.
Wikipedia is not prescriptive; it can at best report what others prescribe. "You should not [otherwise] [do X]" is something Wikipedia must never, ever say. "Smith and Thompson and Jones all agree you shouldn't [do X]" and "nobody [does X] anymore [because]" are fine.
The part about goto was redundant with the section on goto, so I deleted it. The historical and arcane control flow structures were not discussed, so I merged them in their appropriate sections. I'm sad to say the link to Knuth's paper was broken and I couldn't find a substitute; hope you paid those ACM subscription fees. 82.92.119.11 21:26, 14 September 2005 (UTC)
There is a redirect from the ELIF wikipedia entry, but although this is a subclass of the IF command, there is no reference to ELIF in this article
IMHO Statements are a larger group containing control flow constructs as special case. For example: Many programming languages have assignment-, declaration-, I/O- and assert-statements which are not control flow constructs. I improved the statement article a little bit and added some links to it.
I think the modlue has to many language examples. We should realy concentrate on the actual contruct and how it works and leave programming language dependent part to pages describing that language - or even and better Wikibooks.
As it is I think the page is not clear enough
--Krischik T 11:49, 17 February 2006 (UTC)
I think it's biased towards procedural languages (e.g. Pascal, C), which aren't too different. We should add examples from languages with more unconventional syntaxen and semantics — Preceding unsigned comment added by 66.235.50.85 (talk) 17:44, 23 June 2012 (UTC)
As Ada actualy got the Loop with test in the middle I wonder ot it actually is a Proposed control structure. --Krischik T 07:25, 23 February 2006 (UTC)
In 6 Structured non-local control flow it says: "Exceptions, conditions, and continuations are three common sorts of non-local control constructs."
Are PL/1 conditions any different from exceptions? If so, the article should explain how; if not, the two sections should be combined.
-- Brock
I don't know about PL/1, but the distinguishing feature of conditions in Common Lisp is that they can be ignored (if they are not errors) and resumed (with restarts). In other words, unlike exceptions, the stack is not always necessarily unwound. --FOo (talk) 23:44, 9 March 2008 (UTC)
For these reasons:
Deep break/early exit is simulated in C and C++ not through exceptions but via goto's and labels. Also, infinite loops which are conditionless are simulated through labels and gotos as well; this avoids a conditional check if you really want an infinite loop.
ó
There was some confusion over when the else-clause of a Python for or while loop is executed. A simple test case shows this
for i in [42]: if i == 42: print 'Breaking out of for loop' break else: print 'In else clause of for loop'
when run outputs only "Breaking out of for loop". Likewise changing "i == 42" to "i == 99" and re-running only outputs "In else clause of for loop". So the else clause is executed on if the loop is not exited early by a break statement. -- Dmeranda 16:37, 19 March 2007 (UTC)
If you type in the word: "then" it comes to this page, however this is about Control Flow. LostNecromancer 22:58, 10 April 2007 (UTC)
This article (Control flow) is quite long - even, I would argue, overlong - and the section called "Choice" is now long enough to be an article in its own right. However, there is already an article about conditional statements, which does not include all the material in this section. If there is to be a separate article about conditional statements, that article should be longer and more in-depth than the corresponding section on this page. Therefore, I propose merging the material in the "Choice" section into conditional statement, and leaving behind a Main Article link, possibly with a short summary (it's usual to have such a summary).
Some might argue that case statements are not conditional statements. However, they are frequently classified as such, and they meet the general definition given in the conditional statement article, so I don't think this position would be justified.—greenrd 13:33, 14 April 2007 (UTC)
The "Loop system cross reference table" has a "continuation" column, but from what I can tell, it's not the normal meaning of continuation in computer science; for instance, I'm reasonably sure Java doesn't support continuations, but it's listed as having them in the column. Is "escape continuation" meant instead, or what? --Cybercobra (talk) 03:32, 18 February 2009 (UTC)
It seems anomalous that conditionals and switches have their own articles, but there is a huge wodge of material on loops here. 1Z (talk) 00:08, 17 July 2011 (UTC)co
for(;;); executes forever. — Preceding unsigned comment added by 89.189.20.20 (talk) 13:01, 26 March 2012 (UTC)
The section on categories says that loop is "the same as conditional branch". But that is not true. What is introduced with loops is the concept of iteration, and there is no way to express iteration just by using sequences of conditionals. — Preceding unsigned comment added by 2003:88:6907:9216:E854:9D05:CA8D:611E (talk) 12:26, 10 February 2017 (UTC)
Hello fellow Wikipedians,
I have just modified one external link on Control flow. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.
This message was posted before February 2018. After February 2018, "External links modified" talk page sections are no longer generated or monitored by InternetArchiveBot. No special action is required regarding these talk page notices, other than regular verification using the archive tool instructions below. Editors have permission to delete these "External links modified" talk page sections if they want to de-clutter talk pages, but see the RfC before doing mass systematic removals. This message is updated dynamically through the template {{source check}}
(last update: 5 June 2024).
Cheers.—InternetArchiveBot (Report bug) 17:16, 12 August 2017 (UTC)
WEEkped1 (talk) 01:30, 21 December 2018 (UTC)On the contrary...They have 2 separate meanings. One is "flow control" ;is a computer task. Works by correct and discernable directions imbedded in code in 2D. CONSTRAINED TO MOVE GENTLY, LIKE A WATERFALL. It's own known or unknown parenting. The other is the manipulation of the computer limits by formulae and square box repetition. The "control flow" is a constant path smooth and concise that moves according to other paths and instructions. It can be changed. A new part of code that increases knowledge to the computer. It can be altered. It can be expelled, force(s) increased or decreased, jammed, under scrutiny of inspection. It can lock out or open. It is flexible when correctly coded. It can hold files, thus open to directions flowing as "control flow" is used constantly. Both "control flow" and "flow control" are wide amplitudes fitting in the Cos/Sin of a moving map. Technology will require more from dx/diag. Then the width and depth, color(s). Moving parts and characters and trees. They are manipulated by point and click. So the coder does the "flow control" AND THE COMPUTER ALLOWS FOR MOVEMENT programmed by extensive outer forces known in short: magic. It is done behind and in front of the hardware--WEEkped1 (talk) 01:30, 21 December 2018 (UTC) Or... "Control Flow" term considered meaningless (because it's wrong)
In the (correct and meaningful) terms "flow control" and "control of flow", the word flow is an abbreviation of "flow of execution". In addition, the word flow means something similar to "sequence". So the term "flow of execution" means, roughly, the "sequence in which instructions are executed".
And this is what is controlled. That is, it is flow that is controlled. It is NOT control that is flowed!
Just as we have "temperature control" (or the "control of temperature"), and "volume control" (or the "control of volume"), and "motion control" (or the "control of motion"), so too do we have "flow [of execution] control" (or the "control of flow [of execution]").
I can only speculate about how such an abomination as the meaningless term "Control flow" came to be used so frequently. Perhaps somewhere, decades ago, people sat in CS lecture theatres struggling to keep up with their lecturers and by mistake scribbled down the words "control flow" in their notes 10 seconds after the lecturer had used the correct term, "flow control". (Or perhaps the lecturers made the mistake.) And failing to properly parse and understand the components of the term, and probably as a result of much buggy parroting, the meaningless term "control flow" gradually became used with increasing frequency, spreading like a disease. :)
Think about it: control statements (selection statements like if and switch, loop statements like while and do, jump statements like break, continue etc) control what happens next. They control the sequence. The flow. They control along which path of the FLOW diagram execution will proceed. They don't "flow" (as though "flow" means something like decide or control!) which path of a "control diagram" execution proceeds along!
By all means, use the term "Control flow!" as an imperative, as a command (e.g., next time you're speaking to a voice-activated valve??). But "control flow" has NO MEANING as a thing, as a compound noun. Control is not an adjective to describe a type of flow!
Therefore I propose that this whole article be renamed "Flow Control" - the correct term - and that every reference within the Wikipedia universe to "control flow" (ughh!) be suitably modified too.
-- Andrew Fallows (andyfallows at btinternet.com)86.135.63.40 (talk) 14:14, 17 October 2017 (UTC)
The article starts out talking about "control flow", then later mentions "control flow constructs" and "control structures", without providing a definition of these terms or their relationship with the term "control flow". This should be clarified in the article. Daask (talk) 17:08, 1 December 2024 (UTC)
The example of Ada "middle exit" for Ada
exit Read_Data when X = 0;
is syntactically or semantically no different from e.g. Perl
last if $x == 0; # or last ReadData if a loop label has been defined
Perl is just an example I happen to know about, but I am sure there are other languages which qualify too.
Therefore I think either the column "middle" should be researched better, or the feature should be rethought, it is not about whether there can be test in the middle, but more about whether a loop can be controlled from inside the loop.
I am *guessing* the argument for Ada having a "middle test" is that maybe the language specification explicitly mentions the possibility as part of defining the loop structure. But e.g. for Perl the "last", "next", and "redo" are loop controls that can be applied anywhere, including inside the loop. 86.115.57.176 (talk) 05:44, 28 June 2025 (UTC)