I said that foreach loops are faster than classic C-style loops. Yes, you can write a classic C-style loop using foreach. But nobody thinks that way.
And indeed iterating directly over a list is *significantly* faster, less error prone, etc, than doing an explicit loop over the indices, looking up array values inside the loop. That is not disinformation, that is simple fact and I have found that that factual information carries a lot more weight with C programmers starting out with Perl than saying, "Well the standard Perl idiom is..."
Have you ever said, "This is Perl Style and easier to understand." and been told, "Well I am a C programmer, I have been using for loops for 15 years and they are easier for me to understand because I am used to them."? You won't win that argument...
In reply to RE: RE: Buzzcutbuddha(You provided disinformation): C Style For and Foreach The Same
by tilly
in thread Finding the length of an array of arrays
by target
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |