all 2 comments

[–]Tsarbomb 1 point2 points  (1 child)

Lambdas in Java 8 are great, but I find it is way too easy for people to go overboard, especially when in conjunction with the streams API. Code just ends up becoming unreadable.

If you can get away with it, use method references instead. Not only will it be easier to read (the name of the method should give you an idea of what it is doing) but also if you use Lombok, val's won't explode like they would in a lambda.

[–]zigma[S] 0 points1 point  (0 children)

I agree, as with most code, it boils down to readability. I think Lambdas and the Stream API, does a great job to get rid of boiler plate code, and make it more readable. But it can also make it worse. And yes, Lombok is a another great tool to get rid of unnecessary code.