• @[email protected]
    link
    fedilink
    6
    edit-2
    1 day ago

    I don’t understand, if you’ve got easy to delete copy-pasted code, then delete it. It’ll be a nice and cathartic exercise.

    But sounds like what you’re really talking about is code that isn’t easy to delete.

      • @[email protected]
        link
        fedilink
        18 hours ago

        I think the responder means that duplicate code is usually easy to refactor into single methods. Typically I see copy pasted code that is changed just a little bit. However much of a duplicated function can be broken into smaller functions and the redundant code removed in favor of calling into the functions. Often what is left then becomes easier to reason about and refactor accordingly. I love the PRs that I make which delete more code than I add but still manage to add functionality. It doesn’t happen often but it’s fun when it does.

        • @[email protected]
          link
          fedilink
          12 hours ago

          Right, but my initial comment was about article’s statement being wrong. Refactoring in the way you described will make code harder to delete which is bad according to the article.

          • @Evotech
            link
            11 hour ago

            Sounds like you read the first paragraph only