• @[email protected]
    link
    fedilink
    4
    edit-2
    7 months ago

    I don’t see the need for an if block or renaming the function and leaving it there. It is extra unnecessary work for the compiler. Comments are probably the best way. Might also copy the current file, put the original in some folder like “old”, and delete the old code inside the new copy.

    • @dmrzl
      cake
      link
      9
      edit-2
      7 months ago

      Comments are the worst as they are ignored by refactoring. That’s the reason if (false) is actually really good for temporarily disabled code.

      • @jormaig
        link
        17 months ago

        I never thought of that. That’s quite smart!

    • @[email protected]
      link
      fedilink
      37 months ago

      On a modern computer dead code analysis with constant folding should be nearly unnoticeable when compiling a large project