Java Collections Puzzlers by Maurice Naftalin And José Paumard

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

Devoxx

Devoxx

Жыл бұрын

The Java Collections Framework is the most widely used API - probably in your application too. You use it all the time, but do you really know your way around it? You can be surprised even by common classes like ArrayList and HashMap, let alone by the handling of null values or immutability in lesser-known classes. In this interactive session, we’ll look at some obvious code and its less-than-obvious effect. It’s up to you to guess the outcome! But everything will be explained, and you’ll end up knowing how to avoid pitfalls, both well-known and obscure, in using the Collections Framework.
MAURICE NAFTALIN
Four+ decades as a programmer, teacher, and author. Java Champion, frequent conference speaker. Disorganiser of JAlba, best unconference in Scotland! Author "Mastering Lambdas". Currently revising "Java Generics and Collections" for a second edition.
JOSÉ PAUMARD
José works as Java Developer Advocate at Oracle. PhD in applied maths and computer science, assistant professor at the University Sorbonne Paris Nord for 25 years, he is a Java Champion Alumni and JavaOne Rockstar. He is a member of the french Paris Java User Group, has been a co-organizer of the conference Devoxx France, and is a disorganizer of JChateau, an unconference held in the Chateau of the Loire Valley. He works on the dev.java documentation and community website, publishes the JEP Café, a monthly video cast on KZfaq, and maintains a french KZfaq channel with more than 80 hours of Java courses. He is also a Pluralsight author in the Java space.
------------------------------------------------------------
INTRO
* visuals & editing by @Mercator
* music : Avocado by Ephixa

Пікірлер: 20
@that_funny_guy496
@that_funny_guy496 Жыл бұрын
Awesome talk, indeed these puzzlers are great source of understanding the Collections framework
@darogajee3286
@darogajee3286 Жыл бұрын
Great talk. Please continue the puzzle
@JosePaumard
@JosePaumard Жыл бұрын
Thank you! Stay tune for more!
@TaranovskiAlex
@TaranovskiAlex Жыл бұрын
Thank you for the great talk! Please continue the puzzlers indeed!)
@JosePaumard
@JosePaumard Жыл бұрын
Thank you!
@KnightOwl42
@KnightOwl42 10 ай бұрын
Some of the puzzles are true mind-benders that show how dangerous the inconsistencies in the collection interfaces can be when the rubber meets the road, and how 'unfortunate' some of the JCL design/definition choices are (to paraphrase Oracle's own Stuart Marks on the subject). Sitting through 52 minutes of faux clueless waffling is a lot to ask, but for me it was definitely worth it. In fact, I plan on going back in there in order to transcribe the puzzles into my eternal programming notebook (CherryTree).
@boyneverstop
@boyneverstop Жыл бұрын
I certainly have learned quite a lot from these quick puzzles. Great work!
@neyaisselkou
@neyaisselkou 4 ай бұрын
I had no idea about the Integer caching mechanism for values between -128 and 127, I disagree though with José on something he said. Getting the value of the 1000 key is still possible. Looping through the entry set of the map and using Integer::equals to compare the keys with a 1000 Integer instance can get us back the key instance for 1000. Not fancy, not saying this is good, but saying it's impossible is actually wrong :) Great presentation by the way, learned lots of stuff about my fav language
@mr.Aliaksei_
@mr.Aliaksei_ Жыл бұрын
Where can I download presentation
@avalagum7957
@avalagum7957 Жыл бұрын
Question 1: I blame the `var` for hiding the type of `intList`
@ZordidMuc
@ZordidMuc Жыл бұрын
No. Blame the lack of a spread operator that needs to be used when handing in arrays as vararg arguments.
@avalagum7957
@avalagum7957 Жыл бұрын
@@ZordidMuc So, if Java had that spread operator, we would have to write var intList = Arrays.asList(...intArray)? How does it work in Kotlin? In Scala, val a: Array[Int] = Array(1,2); val b: List[Int] = a.toList
@ZordidMuc
@ZordidMuc Жыл бұрын
Watching these Java Puzzlers makes me appreciate Kotlin even more...
@redpacifier
@redpacifier Жыл бұрын
I typically enjoy these kind of puzzlers, but when the interfaces are explained incorrectly to introduce the problem, I feel like the entertainment and educational value is lost. For example, question 4a - map.putIfAbsent - was explained poorly: "Does something only if the key is absent". I understand that sometimes you're trying to lead your audience to believe one thing when in fact it does not, but I found it frustrating that these interfaces (which may not be familiar to all developers) were being introduced with blatantly incorrect explanations. I still enjoyed the content, and look forward to more, but I would encourage more "vague-yet-accurate" setup explanations for these interfaces. One of the main reasons I watch content like this is to be educated, and I look to experts like you to provide accurate information. I feel like all the questions prior to 4a had appropriate introductions. With an appropriate setup (that doesn't have to fully explain the interfaces up front), it is still possible to misdirect in an entertaining and educational manner. Thanks for producing this video, and I look forward to future additions to the puzzler series!
@ulutiu
@ulutiu Жыл бұрын
Can't believe so many people were fooled by 1st question
@presmelitovillanueva812
@presmelitovillanueva812 Жыл бұрын
Haha. Did you get it right?
@mirageman2
@mirageman2 Жыл бұрын
Maybe the half a year a new version schedule is a bad thing for the language. So many "guess what it does behaviour" is extremly dirty and the best way to doom java and get it be replaced by languages where you don't have to guess the behaviour, really sad. They should have their APIs being revised by a professional before they bring out a new version.
@zhamed9587
@zhamed9587 Жыл бұрын
I think almost all of these have nothing to do with the half a year new version schedule. The new schedule allows us to get new previous such as Loom and pattern matching.
@MrKar18
@MrKar18 Жыл бұрын
If you know javascript and equality puzzles, you would have same feeling, but everyone likes JS. You ideally won't use these API like this in real word.
@GoodTechConf
@GoodTechConf Жыл бұрын
This is indeed, very sad. They demonstrate how bad and confusiing Java API is becoming. And this is even more sad to show this on a worldwide conference. As they said, you have sometimes a view of the initial list, so it should not be a list interface. They should use something like a View interface which is inherently readonly. Sad. Poor api design.
Common mistakes made in Functional Java by Brian Vermeer
50:09
A JVM Does That??? by Dr Cliff Click
51:59
Devoxx
Рет қаралды 19 М.
Как быстро замутить ЭлектроСамокат
00:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 13 МЛН
Creepy Teacher Kidnapped My Girlfriend?!
00:42
Alan Chikin Chow
Рет қаралды 12 МЛН
Эффект Карбонаро и бесконечное пиво
01:00
История одного вокалиста
Рет қаралды 6 МЛН
Devin Horsman - Simple, useful software architecture with C4
28:24
Beyond ByteBuffers by Brian Goetz
50:40
Devoxx
Рет қаралды 18 М.
Mastering Testcontainers by Oleg Šelajev
52:24
Devoxx
Рет қаралды 8 М.
Thinking In Parallel by Stuart Marks and Brian Goetz
1:00:04
Helidon - Microservices on Modern Java
40:54
Java
Рет қаралды 15 М.
Многопоточные коллекции - Collections #4 - Advanced Java
35:00
Онлайн уроки по Java
Рет қаралды 35 М.
Collections Corner Cases by Stuart Marks
50:46
Devoxx
Рет қаралды 9 М.
iPhone 15 Pro vs Samsung s24🤣 #shorts
0:10
Tech Tonics
Рет қаралды 12 МЛН
wireless switch without wires part 6
0:49
DailyTech
Рет қаралды 2,4 МЛН
😱НОУТБУК СОСЕДКИ😱
0:30
OMG DEN
Рет қаралды 3,4 МЛН
сюрприз
1:00
Capex0
Рет қаралды 1 МЛН
Iphone or nokia
0:15
rishton vines😇
Рет қаралды 1,4 МЛН