DRY = Don’t repeat yourself

  • AnyOldName3@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    4 days ago

    This is silly. Everyone knows that DRY is telling you that if you do the same sequence of mouse clicks three times in a row, you should spend the day writing a script to automate the task instead of quickly finishing what you were doing by doing the same sequence of clicks a fourth time. If you are supposed to apply it to the code you write, then there’d never be boilerplate-heavy languages like Java.

    • cbarrick@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      3 days ago

      You are wrong.

      DRY has been applied to written code at least since the book Clean Code, which has been widely recommended to programmers for nearly two decades.

      I’m not making a stance here about whether or not that is the right recommendation, but saying that DRY was never meant to be applied to “the code you write” is simply wrong.

      (I remember DRY being pushed before that book, but it’s the only primary source I have at this moment.)

      • AnyOldName3@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        3 days ago

        I thought I was clear enough there that I could get away without a /s at the end. Of course the real meaning isn’t it’s a really good idea to spend a day automating four mouse clicks you only need to do one more time.