Tidy First Kotlin - Removing Redundant Code

Поделиться
HTML-код
  • Опубликовано: 26 дек 2024

Комментарии • 4

  • @TimSchraepen
    @TimSchraepen Месяц назад +3

    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 Месяц назад +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  Месяц назад +2

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