Refactoring to Expressive Kotlin | Dmitry Kandalov and Duncan McGregor

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ต.ค. 2024

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

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

    Fun to watch

  • @mytubekt
    @mytubekt 2 หลายเดือนก่อน +2

    Very nice talk! Thanks for sharing.

  • @three-alpha-six
    @three-alpha-six 3 หลายเดือนก่อน +20

    That definitely was the most excruciating rename of a simple function that wasn’t even necessary in the first place.

    • @GeorgeC-ur9yw
      @GeorgeC-ur9yw 2 หลายเดือนก่อน +2

      at least it was not put into a separate module with abstraction following all the best practices/industry standards of clean architecture

    • @andreroodt4647
      @andreroodt4647 2 หลายเดือนก่อน

      It's great for hourly contractors. Adding this to my toolbox for sure. 🙂

  • @emmanuelmtali1594
    @emmanuelmtali1594 2 หลายเดือนก่อน +1

    You wasted my time a little bit 🤕 (Renaming)

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

    I always *beg* my fellow devs not to use also, apply, let (or other scope functions). They make the code a PITA to read.

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

      It's interesting that it isn't a consensus on whether it makes the code more or less readable to use those scope functions. I've found situation where it made sense to use them and definitely situations where it doesn't. The big value of the refactoring they made, to me, was the decoupling, not the readability, but readability is so intrinsically connected to familiarity with the code base, the language and the common standards that I don't see this as a bad thing, inherently. I wonder if the kotlin compiler yields the same bytecode in the end, inlining those extra functions and lambdas...

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

      @@hkupty yeah the bytecode is the same. Although I'm not sure about non-jvm platforms, especially when creating a standalone binary.
      Kotlin's goal is to be readable, and most of the times those scope functions are abused. I'm OK on using them when initializing a property, for example, so that I clearly see what's going on in that block.

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

      @@lppedd If it's bad on non-JVM platforms, that's definitely a missing optimization and should be reported

    • @tompov227
      @tompov227 2 หลายเดือนก่อน

      Interestingly I find let very confusing by I like with, apply, and especially also