Why don't we call the for loop what it really is, a foreach loop?

Ian Kelly ian.g.kelly at gmail.com
Tue Sep 13 17:20:19 EDT 2016


On Tue, Sep 13, 2016 at 2:57 PM,  <rgrigonis at gmail.com> wrote:
> It would help newbies and prevent confusion.

Ada uses "for".
C++11 uses "for".
Dart uses "for".
Go uses "for".
Groovy uses "for".
Java uses "for".
JavaScript uses "for".
MATLAB uses "for".
Objective-C uses "for".
Pasceal uses "for".
Perl moved from "foreach" to just "for" in Perl 6.
Ruby uses "for".
Scala uses "for".
Swift uses "for".

Why do you think it's confusing that Python uses the same keyword in
its foreach loops that all the above languages do? What mistake is
this causing newbies to make?



More information about the Python-list mailing list