• @[email protected]
    link
    fedilink
    English
    54 hours ago

    I spent like 3 hours yesterday deduplicating two functions that were hundreds of lines long and nearly identical. I should probably learn how to use that git command that can diff two files on disk. Luckily I actually enjoy cleaning up code sometimes.

    • @expr
      link
      52 hours ago

      That’s what the diff tool is for.

    • @[email protected]
      link
      fedilink
      84 hours ago

      If you’re using a decent development system, you’ll have an executable called diff installed already :)

    • @[email protected]
      link
      fedilink
      34 hours ago

      VS Code’s diff tools are killer. Comparison is smarter than most, and you can edit either file as you go.

      • @[email protected]
        link
        fedilink
        English
        34 hours ago

        And if you want to avoid the Microsoft stank, there’s VS Codium that has been de-Microsoft’d, like Chrome vs. Chromium.

    • @FizzyOrange
      link
      24 hours ago

      If you use VSCode, open both files and then ctrl-shift-P “Compare active file with …”

      You’re welcome.