2 ms·
Rereading the same loop more than once is not a good use of time. A generic function can be named and reused forever.
by erik_seaberg 5y ago
Rereading the same loop more than once is not a good use of time. A generic function can be named and reused forever.
- skybrian 5y agoWhen I was writing Go I used to write little helper functions named "findThingy" that just wrapped a single for loop. A typical module might have a few of them. It wasn't hard to read and it wasn't that big a deal. I think the boilerplate from error handling hurts readability more. It will be nice not to have to do that, though, if I get back to Go again.