3 ms·
Iterators are often nice, but are no replacement for loops. Try processing multidimensional arrays without loops.
by nsajko 4y ago
Iterators are often nice, but are no replacement for loops. Try processing multidimensional arrays without loops.
- firstlink 4y ago> iterators > without loops This is a false dichotomy. You can use iterators to replace three-clause loops without changing the body: for row in 0..rows { for col in 0..cols { arr[row][col] } } This is far easier to read than three-clause loops which repeat redundant information repeatedly and redundantly.
- nsajko 4y agoOK, but you're still using loops.
- proto_lambda 4y agoYou are, but that was never in question.