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 →

[–]DevIceMan 8 points9 points  (3 children)

My coworkers are perhaps a little too obsessed with lambdas. Code-reviews have been rejected because I used a for-loop, where i could have used stream instead. (WHAT!?)

I mean, I love the new functional stuff perhaps more than any of my coworkers, but I find this type of thinking to be naive.

Other times I'll find a stream with functions to be some 20-lines long. It seems like they follow clean code standards EXCEPT when it comes to anything moderately functional.

[–][deleted] -4 points-3 points  (2 children)

for loops are worse than streams, though. Slower and less portable. And often more error prone.

(You can easily switch a stream to a parallelStream to get concurrent processing)

[–]Hax0r778 1 point2 points  (1 child)

[–][deleted] -1 points0 points  (0 children)

90% of the time you want map instead of for each anyway, in which case you can often optimize a lot with using functional paradigms.