• bradboimler@lemmy.world
    link
    fedilink
    English
    arrow-up
    12
    ·
    edit-2
    2 days ago

    I write my code for future maintainers. I optimize for clarity, testability, and readability.

    I’ve become a huge fan of dependency injection. That does not mean I like DI frameworks (Guice). I tend to do it manually with regular code.

    When I maintain code and I sit there wondering what it actually does, I write a unit test for it right then and there

    And so on

        • sip@programming.dev
          link
          fedilink
          arrow-up
          1
          ·
          11 hours ago

          it’s my fav and it’s easy. allows containing details of a lower lever gizmo in a higher level thingamabob and basically free strategy pattern, especially if you use DI… and allows mock/spy testing!