Hm, even today, I have not idea why "for" is used for loops (?) and I'm using it without any problems.
Hm, even today, I have not idea why "for" is used for loops (?) and I'm using it without any problems.
A class mate said his father said they were both pronounced as in English.
We had a fight over this in the playground, and I beat him. So I was right. "input" on the Commodore 64 is pronounced like in Dutch.
(edit: long live the Internet, it's on page 135 of the manual here: https://docplayer.nl/11208014-Gebruikershandleiding-nederlan... . Nostalgia).
In python is pretty direct: “for x in a” translates for for every x in the collection a, do this code...
In C it’s a bit more abstract: “for (i=0; i<10; ++i)” for every i in the range starting at i=0, while it’s less than 10, incrementing... Basically the body establishes a set or collection and the for loop executed the loop body “for” every item in the collection.
Modern languages often use foreach or some other slightly more descriptive name.
I don't think it's much more intuitive in German than in English, probably goes back to the "for each" quantor.
I always read it as inspired by "for values of" which at least in German is a common phrase heard in mathematical courses.
$$ Σ_(i=0)^(20) x² $$
you'd actually pronounce that as "summe für i = 0 bis 20 von x²", which is a good argument for where it might be from.
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.