• KissYagni@programming.dev
    link
    fedilink
    arrow-up
    30
    arrow-down
    1
    ·
    edit-2
    17 hours ago

    “Bad abstraction is worse than duplication”

    Oh shit, thank you so much for this part ! I don’t even count number of time I had to face enthusiasts developers saying "These lines of code are very similar, let’s factorize them ! "

    And that’s how MathManagerHelper class is born…

    • atzanteol@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      8
      ·
      16 hours ago

      God yeah - this hits hard with me. I work in a place where the DRY principle is chanted like a mantra and I have to push back against it constantly. It’s like the one principle jr. devs learn (along with “never hardcode anything”) that just gets applied to everything whether it makes sense or not.

      "These lines of code are very similar, let’s factorize them ! "

      “We should take three simple functions that run similar (but different) things and make them call a single large complicated function that takes a parameter that tells it how to execute!”

      ::shudder::