Thank you for the great content. I really love the way you explain things. I found you looking for coroutines information and I've looked at so many of your other videos. Great content. Keep yo the good work.
Thanks Jon! I know that animation in the wrong place or time can be more distracting than helpful, so I'm trying to be intentional about where I put it. I'm glad to hear that it worked well here! 🙂
This is probably the best Kotlin video I’ve ever seen so far! I don’t think I’ve used collection builders explicitly to be honest and this is pretty amazing! You made the video very simple and very clear! It’s also quite relatable with your example and the way you posed problems and solutions in such a short video! Keep up the good work! 👍
Hey Prosper, thanks so much! I'm actively working on a course, but it's still very early. I'd be happy to set you up with "super-early" access if you're interested. If you're on LinkedIn or Twitter, just send me a direct message (or you can email me... dave at typealias), and I'll get you set up.
@@typealias As an Android dev, Gradle groovy was very complicated for me to understand. Hoping to understand Kotlin DSL better as there is a shift from Groovy to Kotlin as the recommendation now from Google. From basics, to advanced levels possible.
Ah, gotcha - thanks! Yes, the Gradle DSL is definitely easier to use with Kotlin Gradle Script than with Groovy, but there's is still quite a learning curve. I've got some research I'll need to do for that one! I'll get add it to the topic list.
Yeah, I also wish they were in stdlib. While poking around with things, I did see that the Kotlin compiler itself does make use of the immutable collections library. Sounds like the Kotlin team has lots of big things planned for after the K2 compiler lands, so I'm hoping we'll see this library get closer to a version 1.0 after that. Especially since the prototype code they showed about Collection Literals at the KotlinConf keynote included PersistentSet. 😁
I wouldn't worry so much about the temporary list objects; the garbage collector is supposed to be very efficient at cleaning up short-lived immutable objects like those.
Yeah, and in most apps, performance is not as important as good structure and readability, anyway. At least in this case, I'd say we get both better performance _and_ better readability with buildList than with list concatenation. In any case, it'd be interesting to see some benchmarks on different Kotlin targets (JVM, Android, native, JS, WASM, etc.), for different sizes of lists to get a better understanding.
IMO, contents.mapIndexedTo(result) { num, c -> "$num $c" } is more difficult to understand than contents.forEachIndexed { num, c -> result.add("$num $c") } Does mapIndexedTo have any advantage over forEachIndexed?
Hi Ava - As used here, there are no functional differences between those two approaches. The return types are different, though - mapIndexedTo() returns the list, whereas forEachIndexed() returns Unit. So, in situations where you might want to chain calls together, mapIndexedTo() might be a more natural fit. But since we aren't chaining calls in these examples, forEachIndexed() is a fine choice!
@@typealias Got it. Thanks. I wonder why your IntelliJ didn't show a warning at that contents.mapIndexedTo line that the returned value is ignored. Mine sometimes does. Also notice that jdk 15 was used in this video. Was this video recorded 2.5 years ago?
For videos, I often set the inspection level to "Syntax", to minimize distractions. In this case, though, even with the inspection level set to "All Problems", I'm still not getting a warning. Maybe there's a particular inspection that isn't enabled here...? About the JDK - you're very observant! This was recorded more like 2.5 _weeks_ ago. I do actually have more recent JDK versions here, so I'll use those in future videos. 🙂
These are some of the best quality development videos I've ever seen! It's amazing they're free!
Thank you so much, Doug! I'm having lots of fun creating them! 🙂
I’m so glad I found your channel. Thank you for this quality content! As a new-to-Kotlin dev, I greatly appreciate it.
That's very kind of you to say, Derek! I'm so glad you're enjoying it!
Thank you for the great content. I really love the way you explain things. I found you looking for coroutines information and I've looked at so many of your other videos. Great content. Keep yo the good work.
I love the animations on top of the code. Makes it super easy to follow the narration.
Thanks Jon! I know that animation in the wrong place or time can be more distracting than helpful, so I'm trying to be intentional about where I put it. I'm glad to hear that it worked well here! 🙂
This is probably the best Kotlin video I’ve ever seen so far! I don’t think I’ve used collection builders explicitly to be honest and this is pretty amazing! You made the video very simple and very clear! It’s also quite relatable with your example and the way you posed problems and solutions in such a short video! Keep up the good work! 👍
Wow, thank you so much - I'm really glad you enjoyed it! More videos are in the works! 🙂
This awesome, do you have a course? Your teaching style is right up my ally
His website (in the video description) is a valuable resource and his "Start Learning Kotlin" illustrated guide is structured like a course 👍
Hey Prosper, thanks so much! I'm actively working on a course, but it's still very early. I'd be happy to set you up with "super-early" access if you're interested. If you're on LinkedIn or Twitter, just send me a direct message (or you can email me... dave at typealias), and I'll get you set up.
Hi Dave, Very useful video. Thanks :).
Would love to see some content related to Kotlin DSL if possible.
You make all the concepts seems so easy.
Thanks so much, Abhimanyu! Are you looking for content about how to _use_ a particular DSL, or about how to make your own DSLs?
@@typealias As an Android dev, Gradle groovy was very complicated for me to understand.
Hoping to understand Kotlin DSL better as there is a shift from Groovy to Kotlin as the recommendation now from Google.
From basics, to advanced levels possible.
Ah, gotcha - thanks! Yes, the Gradle DSL is definitely easier to use with Kotlin Gradle Script than with Groovy, but there's is still quite a learning curve. I've got some research I'll need to do for that one! I'll get add it to the topic list.
Thank you, I love your videos! I wish the immutable library was part of the standard library 😁
Yeah, I also wish they were in stdlib. While poking around with things, I did see that the Kotlin compiler itself does make use of the immutable collections library. Sounds like the Kotlin team has lots of big things planned for after the K2 compiler lands, so I'm hoping we'll see this library get closer to a version 1.0 after that. Especially since the prototype code they showed about Collection Literals at the KotlinConf keynote included PersistentSet. 😁
Great video Dave! Well done.
Thanks so much Jason! Glad you liked it! 🙂
Already watched all available videos. Very HQ - thanks!
Thanks so much Mike! I'm glad you like them!
I used the immutable collections. I miss that compose multiplatform does not understand that they are stable
Ah, thanks for pointing that out - I didn't realize there's an issue using them with Compose MP. I'll take a look when I get a chance!
as usual quality content ❤
Thank you so much, Sarath!
I wouldn't worry so much about the temporary list objects; the garbage collector is supposed to be very efficient at cleaning up short-lived immutable objects like those.
Yeah, and in most apps, performance is not as important as good structure and readability, anyway. At least in this case, I'd say we get both better performance _and_ better readability with buildList than with list concatenation. In any case, it'd be interesting to see some benchmarks on different Kotlin targets (JVM, Android, native, JS, WASM, etc.), for different sizes of lists to get a better understanding.
@@typealias Yes, I won't dispute the improved readability at all!
Nice topic. Thanks
You're most welcome! I'm glad you liked it! 👍
Useful and clear
Thanks so much, Chris! 🙂
His name is technically "dev lead of kotlin" 😂
Haha, "Dave Leeds" -> "Dev Lead" 😅 I see what you did there!
I continuously forget these exist. 😅
Haha, yeah! It's one of those things that, the more I used it, the more I realized I needed it. 🙂
Make more vids :)
Haha, definitely will do! 😁
IMO,
contents.mapIndexedTo(result) { num, c -> "$num $c" }
is more difficult to understand than
contents.forEachIndexed { num, c -> result.add("$num $c") }
Does mapIndexedTo have any advantage over forEachIndexed?
Hi Ava - As used here, there are no functional differences between those two approaches. The return types are different, though - mapIndexedTo() returns the list, whereas forEachIndexed() returns Unit. So, in situations where you might want to chain calls together, mapIndexedTo() might be a more natural fit. But since we aren't chaining calls in these examples, forEachIndexed() is a fine choice!
@@typealias Got it. Thanks. I wonder why your IntelliJ didn't show a warning at that contents.mapIndexedTo line that the returned value is ignored. Mine sometimes does.
Also notice that jdk 15 was used in this video. Was this video recorded 2.5 years ago?
For videos, I often set the inspection level to "Syntax", to minimize distractions. In this case, though, even with the inspection level set to "All Problems", I'm still not getting a warning. Maybe there's a particular inspection that isn't enabled here...?
About the JDK - you're very observant! This was recorded more like 2.5 _weeks_ ago. I do actually have more recent JDK versions here, so I'll use those in future videos. 🙂