3 ms·
That's one of those things that sounds right only in hindsight. Without the paper tape metaphor, the control flow for repetition might have been called "repeat
by xapata 10y ago
That's one of those things that sounds right only in hindsight.
Without the paper tape metaphor, the control flow for repetition might have been called "repeat" or "iterate". The word "loop" is nice and short, but it's an odd thing to say without the physical clue. The word didn't come up in my mathematical proofs class.
Instead of "patch" we probably would have said "fix" (we still sometimes do).
- eridius 10y agoThe control flow for repetition is in fact called "repeat" in some languages. I don't think the word "loop" stuck around because the metaphor of paper tapes is particularly compelling (especially since we stopped using those a long time ago), I think it stuck around because it's a good short word that means the right thing. And, for example, it's pretty awkward to say something like "a for repeat", but "a for loop" is nice and simple. We probably would have ended up on this word even without paper tapes.
- xapata 10y agoMaybe, but the combination of "loop" and "break" makes a lot more sense if you imagine physically breaking a loop of paper.