3 ms·
you guys have for loops?
by micromacrofoot 5y ago
you guys have for loops?
- progre 5y agoWe used to have. Now we mostly chain map-functions. But there are those rare instances where we don't operate on iterables and still need to do something many times. I've seen people so weirded out by this that they prefer to generate an iterable to work on a rather than to use a for-loop.
- austinl 5y agoThis was my first reaction too. Now I work in a (Swift) codebase where I could probably count the number of for loops we have on one hand. Pretty much everything is done through map/reduce/filter, etc. At first, I thought it wasn't as readable, but now that I'm used to the syntax, I think it's much easier to parse what happening. I know what transformation is happening, and I know there shouldn't be any side-effects.
- deleted 5y ago[deleted]