Should closures be avoided?

Indeed, closures cause bad performance far more often than I’d like—especially because of how nice the syntax for comprehensions and generators is, and how common the pattern of assigning variables inside conditionals is. IMO the objective should be to improve the boxing situation, but I can’t blame anyone for following a heuristic of avoiding closures until that happens.

There was a similar thread a few days ago; do you find this helpful?

3 Likes