Iteration vs. Repetition
What is the difference between "iteration" and "repetition"?
I have looked on wiktionary but I can't catch the difference in their semantics. Does any reference define the difference between these two words?
Wiktionary gives:
iteration (plural iterations)
Recital or performance a second time; repetition.
A variation or version.
- The architect drafted several iterations of the floorplan before deciding on his final design.
(computing) The use of repetition in a computer program, especially in the form of a loop.
(computing) A single repetition of the code within such a repetitive process. The code calculates the appropriate value at each iteration.
repetition (countable and uncountable, plural repetitions)
The act or an instance of repeating or being repeated.
(weightlifting): The act of performing a single, controlled exercise motion; also called a rep. A group of repetitions is a set.
Definitions 1, 3 and 4 for "iteration" seem to be synonymous with "repetition" (obviously definition 1 of it).
Solution 1:
Iteration uses an iterator to count through a list of (usually different) items:
Today, I must:
1: go shopping
2: clean the house
3: mow the lawn
Repetition does the same thing again, and again, etc...:
One sheep, two sheep, three sheep, ...
Solution 2:
Usually, you repeat doing something until a certain condition is met.
(Repeat ... until ...)
On the other hand, you iterate over all the items/elements in a given list/set.
(Iterate over ... and for each ... do ...)
Solution 3:
"Iteration" comes from the Latin "iter" meaning "journey". Iteration is performing the same task at different places or with different circumstances as part of a longer sequence. It is not doing the exact same thing (that would be reiteration - to repeat a journey). The word "Iteration" always conveys the sense of progress, improvement, growth or change.
Repetition, on the other hand, is to perform the exact same action, with no change of circumstance. Unlike "Iteration", "Repetition" does not suggest progress or movement forwards.