Tidy First Kotlin - Removing Redundant Code

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

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

  • @TimSchraepen
    @TimSchraepen วันที่ผ่านมา +2

    That failing test about “remember to close DbItems” was nothing short of wonderful. What a delightfully empathic thing of Past Duncan to have done, in order to help out Future Duncan. ❤

    • @PairingWithDuncan
      @PairingWithDuncan  วันที่ผ่านมา +2

      Thank you. As I hadn’t rehearsed this session, my surprise at the failing test was genuine.
      To be honest though, I doubt whether the time spent writing that test was actually worthwhile. The consequences of leaving a class open are hardly severe, and it’s telling that the name of the test got out of sync because it was an identifier that wasn’t updated in a refactoring.
      So maybe the takeaway should be - you can use tests to maintain code structure invariants, and you can set up tests to let you know when an event has occurred.

  • @user-yf1ml8jt3i
    @user-yf1ml8jt3i 21 ชั่วโมงที่ผ่านมา +1

    But turns out the program is irrelevant, so we can just delete the whole program. It's now much easier to maintain, and takes much less time to compile.

    • @PairingWithDuncan
      @PairingWithDuncan  21 ชั่วโมงที่ผ่านมา +1

      Luckily Alison has re-upped our contract, so we know she wants the functionality we have delivered.