Immutable and Persistent Lists - TypeAlias Show Clip

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ก.พ. 2025

ความคิดเห็น • 16

  • @robchr
    @robchr หลายเดือนก่อน +3

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

    • @CommanderSteps
      @CommanderSteps 24 วันที่ผ่านมา

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

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

  • @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 24 วันที่ผ่านมา

      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 24 วันที่ผ่านมา

      @@teenriot-de True.