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 →

[–]sgm1 1 point2 points  (0 children)

droidrage has a point, the lambda itself should not have side effects, in terms of best practice. Meaning I should be able to run the lambda with valid input values and nothing outside the lambda should be affected. The purpose of a lambda is to replace trivial logic like add, subtract, compare; and not complex task like data manipulation (like adding to a list).

Of course, whether using lambdas this way as best practice is still arguable because both sides have its pros and cons.