Lambdas alone are not a code smell. That is like saying Objects or Functions or even naming things is a code smell just because you can use them in bad ways. It is just to broad a statement to be useful. At best you might say that large/complex anonymous lambdas are a code smell - just like large/complex and badly named functions are. You need to be specific about code smells, otherwise you are basically saying code is a code smell.
I’m not saying that anyone should flag lambdas as a problem in code review, just that when you see one, it’s probably worth taking a second to ask yourself if a named function would make more sense.
Lambdas alone are not a code smell. That is like saying Objects or Functions or even naming things is a code smell just because you can use them in bad ways. It is just to broad a statement to be useful. At best you might say that large/complex anonymous lambdas are a code smell - just like large/complex and badly named functions are. You need to be specific about code smells, otherwise you are basically saying code is a code smell.
Well, remember, a code smell isn’t something that’s inherently bad, it’s “a hint that something might be wrong”.
I’m not saying that anyone should flag lambdas as a problem in code review, just that when you see one, it’s probably worth taking a second to ask yourself if a named function would make more sense.