Intro to Collection Builders in Kotlin

Поділитися
Вставка
  • Опубліковано 8 січ 2025

КОМЕНТАРІ • 43

  • @thatdougsmith
    @thatdougsmith Рік тому +6

    These are some of the best quality development videos I've ever seen! It's amazing they're free!

    • @typealias
      @typealias  Рік тому +1

      Thank you so much, Doug! I'm having lots of fun creating them! 🙂

  • @derekdevs
    @derekdevs Рік тому +7

    I’m so glad I found your channel. Thank you for this quality content! As a new-to-Kotlin dev, I greatly appreciate it.

    • @typealias
      @typealias  Рік тому

      That's very kind of you to say, Derek! I'm so glad you're enjoying it!

  • @eonarma
    @eonarma 4 місяці тому +1

    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.

  • @somethingkindawierd
    @somethingkindawierd Рік тому +2

    I love the animations on top of the code. Makes it super easy to follow the narration.

    • @typealias
      @typealias  Рік тому +1

      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! 🙂

  • @jesprotech
    @jesprotech Рік тому

    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! 👍

    • @typealias
      @typealias  Рік тому

      Wow, thank you so much - I'm really glad you enjoyed it! More videos are in the works! 🙂

  • @prospernglazi7444
    @prospernglazi7444 Рік тому +8

    This awesome, do you have a course? Your teaching style is right up my ally

    • @coalacorey
      @coalacorey Рік тому +6

      His website (in the video description) is a valuable resource and his "Start Learning Kotlin" illustrated guide is structured like a course 👍

    • @typealias
      @typealias  Рік тому +6

      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.

  • @abhimanyu.n14
    @abhimanyu.n14 Рік тому +1

    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.

    • @typealias
      @typealias  Рік тому

      Thanks so much, Abhimanyu! Are you looking for content about how to _use_ a particular DSL, or about how to make your own DSLs?

    • @abhimanyu.n14
      @abhimanyu.n14 Рік тому +1

      @@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.

    • @typealias
      @typealias  Рік тому +1

      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.

  • @stephenmorse8207
    @stephenmorse8207 Рік тому +3

    Thank you, I love your videos! I wish the immutable library was part of the standard library 😁

    • @typealias
      @typealias  Рік тому +2

      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. 😁

  • @JasonYork
    @JasonYork Рік тому +1

    Great video Dave! Well done.

    • @typealias
      @typealias  Рік тому

      Thanks so much Jason! Glad you liked it! 🙂

  • @Mike-er2ih
    @Mike-er2ih Рік тому

    Already watched all available videos. Very HQ - thanks!

    • @typealias
      @typealias  Рік тому +1

      Thanks so much Mike! I'm glad you like them!

  • @ulicqueldromal
    @ulicqueldromal 9 місяців тому +1

    I used the immutable collections. I miss that compose multiplatform does not understand that they are stable

    • @typealias
      @typealias  9 місяців тому

      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!

  • @sarathexp6328
    @sarathexp6328 Рік тому

    as usual quality content ❤

    • @typealias
      @typealias  Рік тому

      Thank you so much, Sarath!

  • @oharaandrew314
    @oharaandrew314 Рік тому

    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.

    • @typealias
      @typealias  Рік тому

      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.

    • @oharaandrew314
      @oharaandrew314 Рік тому

      @@typealias Yes, I won't dispute the improved readability at all!

  • @GB-nn2cx
    @GB-nn2cx 11 місяців тому

    Nice topic. Thanks

    • @typealias
      @typealias  11 місяців тому +1

      You're most welcome! I'm glad you liked it! 👍

  • @ChrisAthanas
    @ChrisAthanas 4 місяці тому

    Useful and clear

    • @typealias
      @typealias  4 місяці тому

      Thanks so much, Chris! 🙂

  • @DiaryAnan
    @DiaryAnan Рік тому +1

    His name is technically "dev lead of kotlin" 😂

    • @typealias
      @typealias  Рік тому

      Haha, "Dave Leeds" -> "Dev Lead" 😅 I see what you did there!

  • @TimSchraepen
    @TimSchraepen Рік тому

    I continuously forget these exist. 😅

    • @typealias
      @typealias  Рік тому

      Haha, yeah! It's one of those things that, the more I used it, the more I realized I needed it. 🙂

  • @pavelpetrov5328
    @pavelpetrov5328 Рік тому

    Make more vids :)

    • @typealias
      @typealias  Рік тому

      Haha, definitely will do! 😁

  • @avalagum7957
    @avalagum7957 Рік тому

    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?

    • @typealias
      @typealias  Рік тому +1

      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!

    • @avalagum7957
      @avalagum7957 Рік тому

      @@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?

    • @typealias
      @typealias  Рік тому

      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. 🙂