It took only over 25 years (since the addition of Collection framework), but better late than never! Sequenced collections will be a blessing. No more things.get(things.size() -1). No more resorting to arrays to access reverse order. Nice!
@JanMichalSzulew Жыл бұрын
Or writing own ListUtils::getLast
@31redorange08 Жыл бұрын
So hyped for Java 29!
@nipafx Жыл бұрын
🤣 Who isn't? It's the LTS after the next LTS after 21!
@VisruthCV Жыл бұрын
Interesting! Thanks for the update! 💛💙💜💚💙
@coileachrua Жыл бұрын
just found the channel - love the videos, really good job
@nipafx Жыл бұрын
Thank you, Josh, that is great to hear! ❤
@S2lyaQ Жыл бұрын
Nice presentation! Thank you very much! :)
@HerbertLandei Жыл бұрын
The world is small, I met Stuart Marks at the JCrete Unconference. Very nice guy btw.
@nipafx Жыл бұрын
He is! Very pleasant to talk to and a well of wisdom and knowledge.
@jbradanfeasa Жыл бұрын
That will be a great addition to the Java Collections Framework. However, I wonder when Project Valhalla will finally ship. Combined with Loom, this will be a major shot in the arm for the language.
@nipafx Жыл бұрын
The biggest chunk of Loom is currently passing the finishing line. Current JEP drafts indicate that virtual threads will be finalized and structured concurrency and scoped value APIs will be in preview soon (hopefully 21). Valhalla is still a bit to go. Personally, I don't expect anything for 21, but have big hopes for 2024.
@jbradanfeasa Жыл бұрын
@@nipafx Thanks for the reply. I started teaching virtual threads to my students when they came out in preview in Java 19 in Sept 2022. Virtual threads are very powerful and a great addition to the language. They are also very easy to migrate to. However, Valhalla could be a game changer for the language in a big data world. Hopefully, it'll ship in preview in the next year. Thanks again.
@JanMichalSzulew Жыл бұрын
I think this video was cut short, there are some quickly moving subtitles near the end about the return type of "Collections::unmodifiableSet"
@nipafx Жыл бұрын
Indeed! I recorded that section but during editing I realized that it's not that interesting and I didn't want to end the praise with a "meh" feature (even if it comes on top). So I cut it, but forgot to remove it from the subtitle file. Fixed that now. Thanks for pointing it out! 👍
@JakobJenkov Жыл бұрын
As far as I have read - it is pronounced "Deck" - not "De-queue". The spelling is also only "Deque" - not "Dequeue".
@goudarpraveenkumar Жыл бұрын
Nice update 👍
@RMBPrograms Жыл бұрын
From the Deque javadoc: "The name deque is short for 'double ended queue' and is usually pronounced 'deck'." 😉
@nipafx Жыл бұрын
Wow, when the pronunciation needs to be explained in Javadoc, that's not a good sign. 😳
@java Жыл бұрын
¯\_(ツ)_/¯
@raniagus7280 Жыл бұрын
Why getFirst(), getLast(), etc don't return an Optional? What if the collection is empty?
@manilladrift Жыл бұрын
Then we throw.
@petitmoi735 Жыл бұрын
Having a getAny would be nice for set as well as removeAny
@nipafx Жыл бұрын
Ha! I'm gonna call you as a witness in my conversation with Stuart. 😁
@konstantingromov6485 Жыл бұрын
Nice. Probably we will receive eventually tuples at some point
@AjayKumar-fd9mv Жыл бұрын
Thanks
@DenisFalqueto Жыл бұрын
Super easy, barely an inconvenience!
@nipafx Жыл бұрын
I_understood_that_reference.jpg 😂
@DenisFalqueto Жыл бұрын
@@nipafx wow, wow, wow.... wow
@rzyr Жыл бұрын
Sounds great! I wonder how it's going to work with PriorityQueue
@nipafx Жыл бұрын
I expect the same as with sorted sets: getting/removing first/last will work but adding not.
@margue27 Жыл бұрын
If Java had extension methods, there would be no need to write such nonsense as things.get(things.size()-1). Also, I'm really looking forward to Java 35, when finally we might get ImmutableCollection as a type. Oh well...
@knm080xg12r6j991jhgt Жыл бұрын
Unfortunately, we still aren't getting a tail() method. Even a view would be nice.
@Sergey111111 Жыл бұрын
I predict next job interview: -What's the differnce in Java collections? -No difference, they are the same. -Here the offer.
@nipafx Жыл бұрын
Is that because neither the interviewer nor the applicant watch this channel? They should've! I scored big points at a job interview in 2014 when I explained the internal tree structure of key buckets in HashMap that was introduced in Java 8.
@Sergey111111 Жыл бұрын
@@nipafx time’s running so fast!
@davidkerr8722 Жыл бұрын
This is a great addition but in not a fan of the naming. . Just "Sequenced", the Collection suffix is superfluous. We don't say ListCollection. . A collection is not a bloody bean, so drop the "get" prefix. "first" and "last"is all we need. . Why the "put" nonsense. English has the perfect words: "prepend" and "append". A good addition but it can be simplified. Less is more.
@_SG_1 Жыл бұрын
I'm with you, but those method names were chosen to retrofit with the old names (e.g. in LinkedList). The other approach would have been to add new methods and deprecate the old ones (and keep them for a long time).
@nipafx Жыл бұрын
A list is a thing, a collection is a thing, a sequenced is a grammar mistake. A sequence would be nice but would that be the sequenced collection, sequenced set or sequenced map? And why does it have such a cool name, but the other two don't? Re method names I agree in principle, but SG explained why these names were chosen: get(i) and getFirst(), add(element) and addFirst(element), etc. just look too good together to split them up.
@bariole Жыл бұрын
That Tiger is very gaudy. Hide the cable. It sticks as sequencedKeySet.. Good video though...
@nipafx Жыл бұрын
Just like with Java, there are deeper reasons for every wart. 😜 The tiger has the same eye color as the couch and the opposing wall and I'm not gonna carve up the wall and re-wallpaper it to hide the cable. I'll probably paint it grey instead. Anyway, I'm glad that you liked the video! 😃
@dimanekr6168 Жыл бұрын
After all this time .... always
@rokkralj9786 Жыл бұрын
Another day, another feature copied from Scala! I guess you need to introduce lastOptional() method, that returns None if the list is empty.