5 ms·
Thanks for the article. Maybe I’m confused, but why in the section near the end about how the two recommendations go together, why is the code this: if conditi
by dg44768 3y ago
Thanks for the article. Maybe I’m confused, but why in the section near the end about how the two recommendations go together, why is the code this:
if condition {
for walrus in walruses {
walrus.frobnicate()
}
} else {
for walrus in walruses {
walrus.transmogrify()
}
}
and not this?
if condition {
frobnicate_batch(walruses)
} else {
transmogrify_batch(walruses)
}
- BenFrantzDale 3y agoI thought that too. I think the point there was that you don’t have to push this notion as afar as in/out of functions: that just flipping them within a function can be beneficial.