423
advanced (lemmy.world)
submitted 3 months ago by hairinmybellybutt to c/[email protected]
you are viewing a single comment's thread
view the rest of the comments
[-] Asudox 4 points 3 months ago* (last edited 3 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.

[-] [email protected] 9 points 3 months ago* (last edited 3 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.

[-] [email protected] 1 points 3 months ago

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

[-] frobeniusnorm 3 points 3 months ago

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

this post was submitted on 21 Nov 2023
423 points (97.1% liked)

Programmer Humor

9822 readers
36 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 4 years ago
MODERATORS