Coroutines: Concurrency in Kotlin
30:22
Reified Type Parameters
10:15
6 ай бұрын
The Essence of Coroutines
8:10
6 ай бұрын
Looking Forward to Kotlin 2.0
10:36
Three Simple Rules for Subtypes
13:52
Every Kind of Class in Kotlin
10:44
Variance... without Generics!
9:01
Intersection Types in Kotlin
8:45
10 ай бұрын
Try-Catch vs. runCatching()
5:53
11 ай бұрын
How to Use Kotlin's Timing API
16:27
Wall Clocks vs. Monotonic Clocks
5:01
Smart Casts with Kotlin Contracts
7:35
Пікірлер
@radekspinka7558
@radekspinka7558 4 күн бұрын
Community comments are great!
@typealias
@typealias 3 күн бұрын
Thanks, Radek. Glad to know you liked that part - we'll plan to keep it as a regular segment! 👍
@MonichGPT
@MonichGPT 5 күн бұрын
Need swift to kotlin
@typealias
@typealias 5 күн бұрын
Maybe check out skip.tools/ ... I haven't used it myself, but it does Swift -> Kotlin, including the UI layer. A few guys from Skip were on the Kotlin podcast recently talking about it: kzbin.info/www/bejne/o5rKaWSoiLyJp68
@MonichGPT
@MonichGPT 5 күн бұрын
@@typealias This is "Swift Multiplatform" but I need to use swift code in shared Kotlin module.
@HoussamElbadissi
@HoussamElbadissi 4 күн бұрын
@@MonichGPT I remember someone at JetBrains saying that the goal is two-way export between Swift and Kotlin. Now they're working on Kotlin to Swift export, then they'll hopefully tackle the other way around. And the delay to this is perfectly understandable; they're trying to make two fundamentally different languages interop with each other. As much as Swift and Koltin look familiar, Swift is quite a beast compared to Kotlin, and functions a bit differently to Kotlin in the lower levels as well (e.g. GC vs. RC). So while Kotlin/Native runs basically at the same level as Swift code (and they both compile down to LLVM IR, and from there they look basically the same to LLVM), it's still quite the challenge to get these languages to "seamlessly" interop without much friction at the higher levels (APIs etc.).
@jackli1924
@jackli1924 5 күн бұрын
As an experienced Android engineer. Should I learn multiplatform technical skills such as KMP, flutter, React Native. Which would be the best one.
@delespai5592
@delespai5592 5 күн бұрын
I would go with KMP, you already know Android and Kotlin and the KMP stack seems to be growing fast.
@jackli1924
@jackli1924 5 күн бұрын
@@delespai5592 Thank you bro, that makes sense.
@stephenmorse8207
@stephenmorse8207 6 күн бұрын
I wish Kotlin would add support for dataarg (similar to vararg). It would make data classes more composable -- e.g. clone a data class with a few more fields without copying the full list of fields.
@magiccuttlefish
@magiccuttlefish 6 күн бұрын
Why is it not here yet 😭
@typealias
@typealias 5 күн бұрын
Yeah, haven't heard tooooo much about that yet! Maybe upvote and/or comment on the issue here: youtrack.jetbrains.com/issue/KT-8214/Allow-kind-of-vararg-but-for-data-class-parameter
@fabianoaugustodemello3582
@fabianoaugustodemello3582 18 сағат бұрын
It was mentioned in this talk (24 minute mark) that it will start in version 2.2: kzbin.info/www/bejne/qnKqe2iwf719bdk
@Das.Kleine.Krokodil
@Das.Kleine.Krokodil 10 күн бұрын
good
@FuzzyHeart-l3o
@FuzzyHeart-l3o 11 күн бұрын
So cool!
@ChristianMielke
@ChristianMielke 15 күн бұрын
this Video is so 🤯I'm a professional Java Developer, wich sitching currently to Kotlin, this is my 3th Video from you, and i love it. This is Nerd P**n
@typealias
@typealias 15 күн бұрын
Hey, thanks so much, Christian! 😁 Glad you're enjoying the videos!
@amiref9178
@amiref9178 16 күн бұрын
Thank you Dave. very clear explanation. more in-depth videos explaining coroutines please.
@typealias
@typealias 15 күн бұрын
Thanks, Amir! I'm expecting to get to some more coroutines videos in the new year!
@АлександрБугримов-о1е
@АлександрБугримов-о1е 16 күн бұрын
Do you plan to implement a Chain of Responsibility?
@typealias
@typealias 15 күн бұрын
Yes, Chain of Responsibility is still on the list!
@smreha
@smreha 16 күн бұрын
Masterfully explained. Loving this series.
@typealias
@typealias 15 күн бұрын
Thanks so much! I'm glad you're enjoying it. More patterns videos coming soon.
@CodeWithLime
@CodeWithLime 17 күн бұрын
Today I learned something new thankyou ❤
@ITksh-zp1ob
@ITksh-zp1ob 18 күн бұрын
just one more example of how kotlin is badly designed
@teenriot-de
@teenriot-de 16 күн бұрын
Its not Kotlins Design, its Javas Design. Kotlin was designed with the intention to give java developers a smooth opportunity to switch to Kotlin. So you have those Java elements in Kotlin still today. Everything Kotlin designed completely on its own has a much higher quality level. But as company you cant throw the industry standard java with all its existing libraries and products away when you want people to take you serious. And they did a great job in solving the dilemmas between Java and Kotlin, as best as possible.
@kirillsh8383
@kirillsh8383 16 күн бұрын
​@@teenriot-de ahaha, very funny
@LightDante
@LightDante 18 күн бұрын
11:29 Can you show the code snipet?
@smreha
@smreha 19 күн бұрын
All the things are neat. It would be great if you also explain each of such cool language features with a practical use case.
@LightDante
@LightDante 20 күн бұрын
why is this api still unreleased?
@typealias
@typealias 19 күн бұрын
Yeah, seems pretty stable by now. There are quite a few official libraries, and I'm sure they all took a back seat to K2 until earlier this year. The roadmap shows a focus on ktor, exposed, kotlinx-datetime, and kotlinx-io. So this one might stay in its current state for a bit.
@gb_kash
@gb_kash 20 күн бұрын
Awesome 👍
@teenriot-de
@teenriot-de 20 күн бұрын
I wish the kotlin team had thrown away the java collections from beginning. They are so f***** wrong and Kotlin made it even more worse, (whats not their fault). 1. Iterating over an arraylist by index and get method is significantly faster than all other methods. The problem is, in kotlin using the lesser conrete type List for definitions is common. Even when all the Lists are 95% Arraylist you cant be sure. Its also possible that the List you got from somewhere is a Linkedlist and you go to performance hell with get method. 2. The problem is that the java lists are poorly optimized. When you want full performance you cant rely on the build in non existing optimizations, you have to optimize from outside. But when everybody uses non concrete types for defining their members and returns you have no chance. Best example is listOf() which creates a ArrayList but returns it as List. Knowing its an Arraylist would give you the possibility to optimize, but the information is just thrown away. If the collections would be well implemented it would be a good practice to use non concrete types, but they are not. 3. Java is unable to give lists a search(lambda) method in decades!!!!. It just have a forEach method. Where is the problem? The problem is that you have to use iterators when searching things since you should not use get-method because of not random access lists. So there is unnecessary object creation for such simple tasks even in kotlin even for arraylists what just a bummer. Java just have to add a search method to the list interface with a default implementation and let derived classes implement their optimized versions. 4. There is a RandomAccess-Interface for lists in Java, nice. ArrayList implements it, LinkedList dont, nice. But the Java-geniuses thought its a good idea to let RandomAccess not derive from List. Its a pure marker interface providing zero methos. WHY??? So we have RandomAccess which can do fast gets but it has no get-method and we have LinkedList which has a get-method but O(n) means it doesnt work. The existence of LinkedList.get() is a crime. But no problem, just hide the crime and let others run into problems: val iFeelAshamed : List<T> = LinkedList<T>. Using the non conrete type in this case doesnt even prevent optimizations it introduces heavy deoptimization The list goes on and on. Overall, i say: Mark java collections as depcreated and replace them by a modern, thoughtout and well implemented new library. Yes, i spent too much time in useless micro benchmarking last days and i saw things you have to call war crimes. Kotlin cant fix it by sugar and cosmetics.
@robchr
@robchr 20 күн бұрын
This is why Compose by default does not treat `List` as stable since it may actually be mutable.
@pablovaldes6022
@pablovaldes6022 20 күн бұрын
I just treat my mutable list carefully and that's it. Immutability is mental 😅
@typealias
@typealias 20 күн бұрын
I'm guessing that's the approach that most developers take. Just gotta watch out for that shared mutable state - thankfully if you're targeting JVM, you've at least got some options for synchronized or concurrent collections.
@jansmycka4338
@jansmycka4338 20 күн бұрын
"a MutableList" sounds awfully similar to Immutable list 😅
@typealias
@typealias 20 күн бұрын
Haha, it sure does! It tripped up the transcribing software at least once, but I think I caught them all, so hopefully the subtitles are all correct. 😂
@teenriot-de
@teenriot-de 20 күн бұрын
Yeah, "ReadOnly" is a better choice imho.
@funnysaltyfish
@funnysaltyfish 20 күн бұрын
I never know this feature before, and after trying it, I find an interesting case: For this function: fun sum2(vararg args: Int): Int { return args.sum() } println(sum2(2, 3, 4)) When changing it to anonymous function like: val sum2 = fun(vararg args: Int): Int { return args.sum() } println(sum2(2, 3, 4)) IDE warns that `Vararg on this parameter is useless` and the call way is incorrect: `The integer literal does not conform to the expected type IntArray`. IDE tells me that the type of `sum2` is `(IntArray) -> Int`. However, after changing it to: val sum2 = fun(vararg args: Int): Int { return args.sum() } println(sum2(intArrayOf(2, 3, 4))) // here, wrap it with `intArrayOf` The IDE dose not show error lint, however, it cannot be compiled successfully: `Argument type mismatch: actual type is 'kotlin.IntArray', but 'kotlin.Int' was expected.` IDE is in K1 mode and Kotlin version is 2.0.21. Is that a bug or intended behavior?
@guai9632
@guai9632 19 күн бұрын
looks like a bug in IDE
@Jason-o5s
@Jason-o5s 21 күн бұрын
Cheer~~~the fact or quality of being different, divergent, or inconsistent.😊
@nishchal.v
@nishchal.v 21 күн бұрын
Awesome kotlin content on this channel!🙌
@typealias
@typealias 19 күн бұрын
Hey, thanks so much, Nishchal! I'm glad you're enjoying it! 🎉
@Nick-cx4rs
@Nick-cx4rs 21 күн бұрын
anonymous functions are useless should be removed.
@guai9632
@guai9632 19 күн бұрын
but they bring more fun ;)
@warTag68
@warTag68 22 күн бұрын
Very well explained. But as a non native-english speaker it's difficult to wrap my head around the meaning of keyword yield in this context
@douglas8245
@douglas8245 19 күн бұрын
yield as in "give way"
@MemooHamed
@MemooHamed 22 күн бұрын
Can we code a game with kotlin???
@typealias
@typealias 19 күн бұрын
Sure! Kotlin isn't the optimal language for creating AAA game titles, of course, but check out what you can do with KorGE: korge.org/
@pradeepkumarreddykondreddy7048
@pradeepkumarreddykondreddy7048 23 күн бұрын
I could not understand sealed class properly.
@davidtrpchevski
@davidtrpchevski 23 күн бұрын
The moment I saw the return type as a Composable lamda, my jaw dropped. I learn from this channel every single day! Thanks, can't wait for the paperback version of the book!
@typealias
@typealias 19 күн бұрын
Hey, thanks so much - I'm glad you've been enjoying it! I'm actively working on getting that paperback book available as soon as I can 👍
@Alchemist10241
@Alchemist10241 25 күн бұрын
Mr. Grumpy is always right and Dave is always wrong. just kidding. using contracts to check if a variable is null or not, simplifies the code a lot and makes it less error prone
@typealias
@typealias 19 күн бұрын
Haha, Mr. Grumpy usually has a good point! 😁
@kela2812
@kela2812 25 күн бұрын
Thank you for this video! your explanations are so clear
@typealias
@typealias 25 күн бұрын
Thank you so much! I'm glad it was helpful!
@ЕгорМазур-х1с
@ЕгорМазур-х1с 26 күн бұрын
Great video! But what is anonymous function from internal POV? I mean lambda is anonymous class
@RomanDawydkin
@RomanDawydkin 26 күн бұрын
So, with *this* kind of composition, we have one vehicle inside another vehicle?
@hosenalzuhile3019
@hosenalzuhile3019 27 күн бұрын
In our religious, Islam It's encouraging people to smile at each other The prophet Muhammad said "Your smile in your brother's face is charity" Thanks for sharing Dave ❤ Can't wait for your next video
@ss12p
@ss12p 27 күн бұрын
You’re the best! I was wondering if you could consider making a video on Kotlin Flows. It would be really helpful to see topics like- Flow, StateFlow, SharedFlow
@typealias
@typealias 25 күн бұрын
Hey, thanks so much! That's a great idea - I'll add that to my list for upcoming videos!
@osisuper98
@osisuper98 28 күн бұрын
You are the best man
@4movieslove
@4movieslove 28 күн бұрын
Gratitude helps feel better.
@Alchemist10241
@Alchemist10241 29 күн бұрын
Based on this, operator functions like filter, map and find, all are using decorator pattern under the hood.
@typealias
@typealias 28 күн бұрын
Well, the purpose of the decorator is to allow you to change the behavior of a function dynamically without class extension. A collection operator chain like you're talking about would work similarly in that it'd make incremental transforms to the data that it starts with. But the reason I wouldn't consider them decorators is that they aren't creating an object that can be called multiple times - when you call them, they return a result rather than an object that can return a result. With the logger example at the end of this video, the fluent function calls are creating something that you can call later. Hope that makes sense!
@Alchemist10241
@Alchemist10241 28 күн бұрын
@@typealias thanks for the dedicated reply.
@Ashish_singh_dev
@Ashish_singh_dev 29 күн бұрын
Now I'm confused whether to love this language or hate it
@typealias
@typealias 28 күн бұрын
Haha, you should definitely love it!
@kenkiarie
@kenkiarie 29 күн бұрын
Thank you.
@gunishjain9307
@gunishjain9307 29 күн бұрын
Great Explanation!
@ericksumargo694
@ericksumargo694 Ай бұрын
Probably most Jetbrains folks not even aware such anonymous fun syntax!
@_mubir
@_mubir Ай бұрын
how using inline function allows lambda function to return values ?!
@LightDante
@LightDante Ай бұрын
Can you explain how `where` work? Any other examples?
@jamesroome4485
@jamesroome4485 Ай бұрын
Loving the content. I think a great future topic could be building in-line DSLs.
@typealias
@typealias 25 күн бұрын
Hey, thanks James! Yes, I've got some DSL-related content in the works, so stay tuned!
@navdeepsinghbedi6218
@navdeepsinghbedi6218 Ай бұрын
Thanks Dave, these videos are so good. I have been using Kotlin in old Java ways, not really using the language features.
@typealias
@typealias Ай бұрын
Hey, thanks so much Navdeep! Yes, it's natural to bring along the mental model from previous languages we've worked with. Takes a little while to adjust to the new language features.
@gb_kash
@gb_kash Ай бұрын
Thanks Dave! Your Kotlin content is Gold.
@typealias
@typealias Ай бұрын
Thanks so much, GB! I'm glad you're enjoying it! 🎉
@IncompleteTheory
@IncompleteTheory Ай бұрын
All very interesting, but a double-edged sword. The usefulnes is limited and comments here prove that it is widely unknown. I understand that this may be a product out of genericity and completeness, but it in my book a language is a means of communication between developers. What I write, another needs to understand. If they have to ponder on a piece of code due rarely used idoms, it slows them down and they might miss crucial implications (here: return value logic.) Don't get me wrong, though, it sure is an interesting corner of the language to explore.
@typealias
@typealias Ай бұрын
Yes, always a good idea to be mindful of the experience and perspectives of other developers on the team (both current and future). If your teammates aren't familiar with an idiom, one option is to avoid it; another is to introduce them to it and see if it's one that makes sense to them and they'd like to adopt. But in any case, development a usually a team effort, and it pays to write code that'll be understood by everyone on the team.
@brunojcm
@brunojcm Ай бұрын
There's a nice rule of thumb for `return` statements for that case with the inline lambda returning the `main` function: a `return` statement always returns the closest `fun`; In the case of the return inside the inlined lambda call, that is the `main` function, and for the anonymous function, it has its own `fun` so it returns there.
@typealias
@typealias Ай бұрын
Hey Bruno - wow, that's a fantastic, simple way to remember it! 🎉 Thanks so much for sharing it
@gb_kash
@gb_kash Ай бұрын
Best Kotlin content! Thanks Dave
@typealias
@typealias Ай бұрын
Hey, thanks GB! I appreciate that!