Better Java Streams with Gatherers - Inside Java Newscast #57

  Рет қаралды 14,563

Java

Java

Күн бұрын

Пікірлер: 23
@kinsleykajiva
@kinsleykajiva Жыл бұрын
Thank you for explaining this as well !
@thoriig3887
@thoriig3887 Жыл бұрын
Looking forward for 461 since Viktor Klangs session about it at devoxx in belgium. making streams so much more versatile and flexible. glad that it gets more love now ❤ kudos to Viktor and you. a major gain for jdk development 🖖
@nipafx
@nipafx Жыл бұрын
Thank you! Positive feedback like this (for both the JEP and the video) is always appreciated. 😊
@tachyba
@tachyba Жыл бұрын
The idea seems very promising, can't wait for it!
@prdoyle
@prdoyle Жыл бұрын
This is big news! Thanks for sharing it!
@npexception
@npexception Жыл бұрын
I've been hoping for something like this to come to Java ever since I started enjoying the many variations of sequence manipulations in Clojure. Can't wait to finally get similar flexibility in Java! :)
@geraldodev
@geraldodev 10 ай бұрын
@npexception do you use both at your current job, or just java ?
@matyas94k
@matyas94k Жыл бұрын
Well, we now need a JEP for Stream Hunters ('dunno, maybe something running on a daemon thread and yielding some specific elements when processing marked streams on the main thread), so we can declare that the Streams API evolved into a hunter-gatherer stage. :D
@nipafx
@nipafx Жыл бұрын
I'll forward this to Viktor (who's idea gatherers are) - let's see whether he can come up with something. 😂
@derrickheng564
@derrickheng564 Жыл бұрын
Keep up the good work Nick!
@nipafx
@nipafx Жыл бұрын
Thanks, I will. 😊
@radoandrey2268
@radoandrey2268 Жыл бұрын
Thank you
@heinrich3427
@heinrich3427 Жыл бұрын
Great addition to the API. It could basically replace all intermediate operations on a Stream. mapMulti, added in 16, already looks like legacy because it is a subset of what Gatherers will provide. A little bit unfortunated.
@nipafx
@nipafx Жыл бұрын
Good point on `mapMulti` - it really feels like a (weak) precursor to gatherers.
@USONOFAV
@USONOFAV Жыл бұрын
8:55 Where did the mapper come from?
@nipafx
@nipafx Жыл бұрын
You mean 2:55, right? The code I show here is somewhat incomplete, so it fits on screen. All gatherers I show would have to be built in and returned from a factory method that takes arguments like the `nrOfElements` for `limit` and `mapper` for `map`. You can see this hinted at in the comment above the snippet I show. To see the full code: github.com/nipafx/demo-java-x/blob/main/src/main/java/dev/nipafx/demo/java_next/api/gather/CustomGatherers.java#L90-L97
@FriendlyNeighbourlyPerson
@FriendlyNeighbourlyPerson Жыл бұрын
I don't understand it. Sounds like it does the same thing as filter
@31redorange08
@31redorange08 Жыл бұрын
Do you know what a filter does?
@nipafx
@nipafx Жыл бұрын
A Gatherer can do all kinds of things. It's easy to implement a filter with it - see 2:26. But you can also implement a bunch of other behaviors. A lot are mentioned throughout the rest of the video. If you want to better understand how that works, check out the companion video on my channel (link in the video description).
@prdoyle
@prdoyle Жыл бұрын
Perhaps try implementing limit() using filter.
@dominicbue1404
@dominicbue1404 Жыл бұрын
haha for that mistake the gatherer will FINISH YOU 😂
@zoladkow
@zoladkow Жыл бұрын
I dunno, thats definitely more lively than coffee sipping, but too much gesticulation makes it hard to follow. I don't think java needs to try this hard to be hip 🤷 Also, would help a lot if it wasn't just one channel, because now we get a mix of different content delivery and presentation styles, while, in some cases, also covering same topics. Whoever would want to see it all, could still subscribe to them all. Got coffee fetish? - go see this distinguished gentleman showing how blissfully he can sip. Got ADHD? - go see a dude armwrestling for your attention. LTT got it right - it seems they have a channel for each taste of content 😁🙃
@nipafx
@nipafx Жыл бұрын
Ouch. I'm not trying anything, it's just who/how I am. 😢 We've been considering having several channels for a while now but there are lots of considerations on both sides of that argument and I don't think we're gonna do it.
Better Java Streams with Gatherers - JEP Cafe #23
1:13:32
Java 21 new feature: Virtual Threads #RoadTo21
33:35
Java
Рет қаралды 73 М.
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН
Java and AI? - Inside Java Newscast #72
9:53
Java
Рет қаралды 22 М.
(Dirty?) Tricks in Java 22 - Inside Java Newscast #64
13:05
Java 8 STREAMS Tutorial
18:10
Programming and Math Tutorials
Рет қаралды 752 М.
Java Streams Tutorial | 2020
19:13
Amigoscode
Рет қаралды 268 М.
Java 22 Unpacking - Inside Java Newscast #59
12:23
Java
Рет қаралды 13 М.
Это лютый угар 🤣 | приколы Арсен Симонян
0:14
Арсен Симонян
Рет қаралды 294 М.
LNS - 2 cô gái tốt bụng || Kind 2 girls #shorts
0:47
Linh Nhi Shorts
Рет қаралды 4,2 МЛН
Pixel 7 и 7 Pro с Face ID - лучше iPhone 14 Pro!
21:12
Rozetked
Рет қаралды 457 М.
Это лютый угар 🤣 | приколы Арсен Симонян
0:14
Арсен Симонян
Рет қаралды 294 М.
Halloween is coming
0:12
Younes Zarou
Рет қаралды 3,4 МЛН