4 ms·
> 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
by 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.