2 ms·
Arguably, a lot of them came through improvements that did nothing to harm simplicity. Removing the unnecessary callback, for example. And ".times" is certain
by vidarh 13y ago
Arguably, a lot of them came through improvements that did nothing to harm simplicity.
Removing the unnecessary callback, for example.
And ".times" is certainly more idiomatic than ".zip" for his case. It's a toss up between .each_with_index and .times, but really both will be readable enough. And from experience, you'll find Ruby devs that are unfamiliar with "zip", but not with "each_with_index" or "times".
"alias_method" is also far more idiomatic than grabbing a reference to the method - I don't think I've ever actually seem method() used in production code (not that I've explicitly looked)