[VDZ22] 9 Java Patterns that Kotlin made obsolete by Sebastian Brunner

[VDZ22] 9 Java Patterns that Kotlin made obsolete by Sebastian Brunner

Devoxx

2 года назад

6,867 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

sarabwt
sarabwt - 14.10.2023 01:18

I almost cannot believe that operator overloading was followed by think about the reader :D the example given is a way to brainfuck everyone reading it, even yourself after 3 months away. Saying movie1 < movie2 has a huge question mark of what you are even comparing. Year of release, number of cast members, movie rating, etc?

Ответить
Laurent Martelli
Laurent Martelli - 14.03.2023 10:40

#9 is also not good in my opinion. The strategy pattern is still useful, and what is presented is not a good use of the pattern. The strategy pattern is not about implementing interfaces. And implementing a FlyBehaviour with "I cannot fly" makes no sense : if you cannot fly, you don't implement the FlyBehaviour.
That being said, delegation is super handy, but we have to find another argument to sell it ;-)

Ответить
Laurent Martelli
Laurent Martelli - 14.03.2023 10:32

#8 is not a good example in my opinion : when you read "four < five" you don't what the comparison is based on. To understand what is going on, you have to read all the code to see where "compareTo" is defined. "four.releasedBefore(five)" would be a much better way to write this so that it's easier for the reader to understand.

Ответить
Don Wald
Don Wald - 14.11.2022 03:21

Optional is even funnier becauses it causes NullPointerException as well as ArrayIndexOutOfBoundsException.

Ответить
Fabricio Araujo
Fabricio Araujo - 21.10.2022 16:24

So kotlin is basically a scala with a good marketing...

Ответить
Jordan
Jordan - 18.06.2022 11:31

Why Kotlin users always spit on Java ? Just move on, and appreciate Kotlin features

Ответить
SirWolf2018
SirWolf2018 - 15.06.2022 02:35

Spring has recently released `andExpectAll` for its `ResultActions` API, so it's slightly less annoying now to make sure all assertions are reported when at least one fails.

Ответить
bizoitz86
bizoitz86 - 30.05.2022 00:44

I wonder what “looking OO (Object-Oriented)” means.

Ответить
Aliaksandr Budnikau
Aliaksandr Budnikau - 21.05.2022 14:21

I was so excited after the first "takeaway" and started thinking that I need to watch the video to the end and then later to show it somebody else to discuss.

Compile time error NPE check is really strong feature. I think in java it can be done by extending the pom.xml with some extra plugins (I am pretty sure). I would really like to have it built in.

Others "takeaways" are more like a syntax sugar or features that incline you, or even forgive you when you write poorly designed code (I mean the method overloading + default values).

I don't want to offend some touchy software engineers but I see only one strong argument here (takeaway#1) and I don't see how it convinces the "business" to start using it.

I am talking only about enterprise level java I am not sure how it works in android world.

Thanks author anyway!

Ответить
Matt Does Tech
Matt Does Tech - 21.05.2022 10:52

Fantastic talk 👏 This is now going to be one of my go to videos when training the Java Devs in Kotlin at work!

Ответить
ZelenoJabko
ZelenoJabko - 20.05.2022 03:39

All these things kotlin stole from scala. Wow such revolutionary

Ответить