Immutable and Persistent Lists - TypeAlias Show Clip

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

КОМЕНТАРІ • 16

  • @LightDante
    @LightDante Місяць тому +1

    why is this api still unreleased?

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

      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.

  • @robchr
    @robchr Місяць тому +3

    This is why Compose by default does not treat `List` as stable since it may actually be mutable.

    • @CommanderSteps
      @CommanderSteps 13 днів тому

      And that’s the reason I use it in my app state - to get stable.

  • @gb_kash
    @gb_kash Місяць тому

    Awesome 👍

  • @jansmycka4338
    @jansmycka4338 Місяць тому +7

    "a MutableList" sounds awfully similar to Immutable list 😅

    • @typealias
      @typealias  Місяць тому +2

      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 Місяць тому

      Yeah, "ReadOnly" is a better choice imho.

  • @pablovaldes6022
    @pablovaldes6022 Місяць тому

    I just treat my mutable list carefully and that's it. Immutability is mental 😅

    • @typealias
      @typealias  Місяць тому +2

      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.

    • @CommanderSteps
      @CommanderSteps 13 днів тому

      Yeah, but you never know what other users of your code/API might do. 😄

  • @ITksh-zp1ob
    @ITksh-zp1ob Місяць тому +1

    just one more example of how kotlin is badly designed

    • @teenriot-de
      @teenriot-de Місяць тому +2

      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 Місяць тому

      ​@@teenriot-de ahaha, very funny

    • @CommanderSteps
      @CommanderSteps 13 днів тому

      @@teenriot-de True.