It isn't wrong, it is just not saying what you mean. map is a transformation. for is a loop. If I use map, it is understood that there are to be no modifications to the original data set (and conversely, if there are side effects, I did it wrong). If I use for, then there is the potential for modification of the original data.
It is, for me, about clarity of intent. That is why I insist (in my code) on this usage.
--MidLifeXis
In reply to Re^3: map vs for\foreach.
by MidLifeXis
in thread map vs for\foreach.
by builat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |