4 ms·
Native English speaker and I also don't really get what "for" was meant to mean. At this point it's probably just something that everyone has memorised and part
by jdnenej 7y ago
Native English speaker and I also don't really get what "for" was meant to mean. At this point it's probably just something that everyone has memorised and part of history.
- deleted 7y ago[deleted]
- yodsanklai 7y agoI'm not a native speaker, but "perform this task, for i in {1,2,3}" seems to make sense as a prose. At least it does in French, when translated literally.
- krzrak 7y agoThe same in Polish.
- ozzmotik 7y agopersonally as a native speaker it has alwaus made sense to me in the sense of saying "for these given constraints, loop while they are maintained" for the arithmetic style for loop, and "for each of these elements" for the more iterator based style.
- jdnenej 7y agoIn python it makes sense but when you have `for(let i=0; I<length; I++)` it makes less sense
- wongarsu 7y ago"for all i smaller than length, starting at 0". It doesn't really map perfectly because in math you usually don't care about the order, so a for loop actually contains more information than the statement it's trying to mimic.
- Izkata 7y agoAlso native English: For me it's always made sense only with the loop body, as "for these do that" Or more straightforwardly, in a way that can be applied to other English constructs, "do that for this group" It's the same "for" in my head in both those versions.
- trophycase 7y agoHuh? It's pretty common even in basic college math courses to use language like "for every p in Q". It's not like programming invented this usage.