Hacker News new | ask | show | jobs
by skybrian 1850 days ago
That’s probably okay if the code is I/O bound anyway, but in Go it will run a lot slower than doing multiple steps within a single for loop.

For loops may be unfashionable but they aren’t hard to read.

1 comments

I don't find iterator combinations hard to read. Especially with postfix methods.

I do find deeply nested for loops with outer variables that might start uninitialized or need to be mutable much more difficult to read.

Sometimes moving an inner for loop to a separate function (that will likely be inlined) is better to explicitly show its inputs and outputs.