this post was submitted on 21 Nov 2023
422 points (96.9% liked)
Programmer Humor
32453 readers
320 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
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.
Comments are the worst as they are ignored by refactoring. That's the reason if (false) is actually really good for temporarily disabled code.
I never thought of that. That's quite smart!
On a modern computer dead code analysis with constant folding should be nearly unnoticeable when compiling a large project