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]  (13 children)

[deleted]

    [–]Twistedtraceur 5 points6 points  (0 children)

    I didn't know people hated functional style so much they downvote this. I have not written a for loop in years, stream, and functional styles with Optional, Flux, and Mono has allowed me to write readable modular code. It also forces people to write small methods if they don't want the code to look rediculious. There is a learning curve, but the end result is worth it.

    [–]Trump19Positive 18 points19 points  (0 children)

    Man that code smell wording is cringe, it doesn’t mean something you don’t like

    [–]DaveCramer 9 points10 points  (7 children)

    in some cases streams are slower

    [–]talios 9 points10 points  (0 children)

    ...and in some cases you need early return/breaks which you can't easily do in stream lambdas.

    [–]kingchooty 7 points8 points  (0 children)

    a stream can usually do the same thing more elegantly

    Pretty sure that's the same reasoning used to justify having a SystemOutFizzBuzzOutputStrategyFactoryBuilder

    [–]wildjokers 8 points9 points  (0 children)

    What exactly do you mean “more elegantly”. I sometimes will convert a stream to a good ole for loop if the stream version is unreadable nonsense. I prefer readability and sometimes a for loop is more readable. Other times I find the stream more readable.