Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.
while ( true )
{
    // what is each time through this loop called?
}
share|improve this question

closed as off topic by Aaronaught, Mark Trapp Jul 27 '11 at 3:28

Questions on Programmers Stack Exchange are expected to relate to software development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
I've flagged this as off-topic merely because I believe this is better suited for English.SE –  zzzzBov Jul 26 '11 at 13:13
5  
@zzzzBov - I would expect English would close it as off topic. –  ChrisF Jul 26 '11 at 13:18
3  
As someone highly active on ELU, I think that it's better for this forum. –  JSBձոգչ Jul 26 '11 at 14:38
4  
I think this might well be covered by this blog post –  ChrisF Jul 26 '11 at 15:20
1  
This question is now being discussed on our meta discussion site. –  user8 Jul 26 '11 at 18:17
show 1 more comment

4 Answers

I would call it an iteration. I don't know if everyone would.

share|improve this answer
135  
Everyone would. –  Scott Wilson Jul 26 '11 at 0:13
9  
The definition of "iteration" in the PC-based dictionary I use (WordWeb Pro) is: "a single execution of a set of instructions that are to be repeated", which fits perfectly with "once through this a loop". So I agree. –  tcrosley Jul 26 '11 at 0:15
    
@psr What would it be called to do a single iteration? –  user32363 Jul 26 '11 at 0:46
3  
@quickly_now : "Pass" is commonly used when the code executed differs in each pass. For instance, a two-pass compiler typically has a 'parse' and 'link' pass. –  MSalters Jul 26 '11 at 8:35
1  
@jay I would say what you said, a single iteration. That makes it clear it was part of a loop that ended early. –  jhocking Jul 26 '11 at 12:56
show 8 more comments

The usual term is a "pass". For example: "This code makes ten passes through the loop. On each pass it computes a local maximum. The best result so far was found during the previous pass and it will be improved this pass."

share|improve this answer
9  
I prefer iteration. Pass is something on a large scale, e.g. two passes of the video encoder (which may or may not be in a loop) –  Bart van Heukelom Jul 26 '11 at 9:06
4  
Or worse: A pass might usually include millions of iterations of twenty six different loops –  Vinko Vrsalovic Jul 26 '11 at 9:58
1  
Pass is also confusing because in some languages it's used specifically to mean skipping an iteration. –  Caleb Jul 26 '11 at 12:27
add comment

The code inside: body

An execution of the body: iteration

share|improve this answer
2  
And code with a body is known as a Code Block. –  justin.m.chase Jul 26 '11 at 12:15
add comment

These days, "iteration" has become the most common general usage. While "pass" has indeed been used, and is still occasionally seen, it is generally semantically bound more to the transfer of values and references as arguments to method parameters.

share|improve this answer
add comment