News for hackers. Stuff that matters.
Re:Net 9.0 LINQ Performance Improvements by svieira on Friday October 18, 2024 @09:25AM (#41879238)
These days it would be

    var lowNums = Arrays.stream(numbers).filter(n -> n < 5).toList();
2024's Java is also quite a bit better than 2013's Java.

Which still isn't as nice as LINQ, but this way we've painted the alternative in its best light, not in the light that makes C# look the best.

Re:Net 9.0 LINQ Performance Improvements by Rohansi on Friday October 18, 2024 @09:50AM (#41879467)
One of the unfortunate pieces missing from Java's streams is the ability to easily extend them with additional operators. In C# they are all extension methods for the IEnumerable interface so you can add your own methods into the chain but that's not possible in Java.
Re:Net 9.0 LINQ Performance Improvements by pjmlp on Friday October 18, 2024 @10:54AM (#41880005)
It is coming, it is called Gatherers, another approach, same result.
Re:Net 9.0 LINQ Performance Improvements by svieira on Friday October 18, 2024 @11:23AM (#41880273)
I'm a huge fan of Gatherers, lovely API!
Re:Net 9.0 LINQ Performance Improvements by Rohansi on Monday October 21, 2024 @09:03AM (#41903726)
Good that there's a solution coming up but it's not as nice as C# IMO. Gatherers are way more verbose both in usage and especially in implementation. In C# they can be written as generator methods which is a very intuitive way to work with streams of data.
Re:Net 9.0 LINQ Performance Improvements by apwell23 on Friday October 18, 2024 @11:35AM (#41880381)
i posted that example from a comment that linked to this repo https://github.com/mythz/clojure-linq-examples

my point was that laguange support for sql like sytax is part of what makes LINQ linq. Java niceties is not relevant.