Linq-like features in Java 8
Introduces “Streams” to remove for loops.
I wonder how it performs compared to for loops?
#java #linq http://www.deadcoderising.com/java-8-no-more-loops/
Linq-like features in Java 8
Introduces “Streams” to remove for loops.
I wonder how it performs compared to for loops?
#java #linq http://www.deadcoderising.com/java-8-no-more-loops/
didn’t read in depth about the feature, however, I did browse the article, first impression:
meeeh
„code more readable¯ OH RLY?!
LikeLike
Going wild with lambdas 😀
Some code examples make me wonder why some methods don’t have an overload. It’s like you would write .Where(…).First in C# but actually First is overloaded to take a delegate, so you just write .First(…).
Though I am jealous of the Optional. I want monads in Delphi 😦
Best example is the grouping into the map. That one is nice!
But comments like “better later that never…” or “welcome to 2007.” make me sulk.
LikeLike
We do something very similar in Mitov.Runtime. We almost don’t use loops any more in our code.
It is done with the Query method on very much all collections in Mitov.Runtime as well as the helpers for number of existing collections in Delphi
LikeLike
Lars Fosdal In most cases performance is the same but using streams you get parallelization for free (just use parallelStream() instead of stream()). It can sound controversial at first but I mostly agree with Michael Feathers that “More languages need to be designed without looping constructs.”
LikeLike
100% Agree with Linas.
This is the main reason we switched to it.
LikeLike
But – this is looping too – you just eliminate the explicit loop variable.
LikeLike
Lars Fosdal This pattern is called collection pipeline (http://martinfowler.com/articles/collection-pipeline/) and it’s much more than just eliminating explicit loop variable.
LikeLike