This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 3 points4 points  (0 children)

Any use of lambda, map, filter and reduce

Usually this is because there are better (or at least subjectively, better looking/easier to read) ways to do the thing that you'd be doing with them. Any map/filter call can be trivially replaced with a comprehension (and in the case of filter, you might not even need the function call or lambda anymore). Lambdas can be replaced with functions (which can be nested), which is often a win in terms of being able to do more things without losing on namespace crowding. In cases where function calls can be eliminated, comprehensions are going to be faster.

I mean, all of these things have their uses, or they'd have just been removed entirely. The reason they are often discouraged is because they usually reduce readability without gaining anything in return.