while ( true )
{
// what is each time through this loop called?
}
Asked
Active
Viewed 3,946 times
28
4 Answers
226
I would call it an iteration. I don't know if everyone would.

psr
- 12,866
- 5
- 39
- 67
-
141
-
10The 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 00:15
-
-
I don't have a nice short way to say that using some form of "iterate". So even though I would usually prefer that over "loop" or "pass" because of all the patterns and interfaces with some version of "iterate" in the name that make it a more specific technical term, I might just call it a pass, depending on the context. So maybe librik deserves a little more upvote love. – psr Jul 26 '11 at 01:06
-
There's another answer here: "Pass". Either can be used. These days, iteration seems to be more common. – quickly_now Jul 26 '11 at 02:01
-
-
Yar... iteration... and the i that is often used in for loops is called the iterator... and a sweep over all objects in an array is called a traversal. – Michael Jul 26 '11 at 03:00
-
4@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 08:35
-
@MSalters: Yes, I know. I also started programming back in the 1980's, and back then "pass" seemed to be a more common term. These days, its fallen out of favour, and "iteration" seems to be more prevalent. – quickly_now Jul 26 '11 at 08:49
-
@quickly_now: I disagree, I haven't had your experience with the word pass as a synonym for iteration. – Vinko Vrsalovic Jul 26 '11 at 10:00
-
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
-
So if I were to tell a loop to do an iteration, would it make sense to tell it to "iterate"? The problem is that "iterate" sounds like looping indefinitely, not just once. If this makes any sense. – Jul 26 '11 at 17:09
-
18
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."

librik
- 345
- 1
- 6
-
10I 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 09:06
-
4Or worse: A pass might usually include millions of iterations of twenty six different loops – Vinko Vrsalovic Jul 26 '11 at 09:58
-
1Pass is also confusing because in some languages it's used specifically to mean skipping an iteration. – Caleb Jul 26 '11 at 12:27
5
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.

John Tobler
- 436
- 3
- 7
single-word-request
. – zzzzBov Jul 26 '11 at 13:21