if and false are precisely the conditional operator and logical false, and not some tricks with macros \ strings, etc.
A couple of answers under the cut. Those who wish to express their ideas are invited by the otgadki immediately in the comments .
Two inadequate options
The programmer needed to create the appearance of work \ paid for the number of lines. Stupid, not interesting, but it happens. We drove.
Somewhere in this function there is a goto into the if block (false) In general, I am not an ideological opponent of goto - sometimes its use is justified. But the transition into an unattainable condition - here or just a mess in the code, or some such deep sacred meaning that I can not understand it. We drove.
Two adequate options
1. Use the if (false) block to temporarily comment on the code. Yes, of course, we have \\ , / ** / (well, or whatever the comment means in your language). But with these things there are the following troubles:
\\ need to be put on each line (yes, some IDEs have hotkeys for this - but not all, and remember, these hotkeys are needed).
/ ** / cannot be nested. If necessary, comment out the code in which there are already such comments, extra actions are immediately added, between which you also need to choose (comment out everything, change the type of comments, delete the internal block of comments)!
Commented code can easily be deleted by another programmer according to the logic “commented out - it means no need”. But it may be necessary, and it was temporarily commented out. The block of uncommented code will most likely be shown more respect.
Commented code is not compiled. If he may be needed in the future - it is likely that he will not work due to changes in his environment.
Commented code is incomprehensible, as it is supported by means of refactoring. Some change it, some ask what to do with it, and some simply ignore it.
When commenting with the if (false) block, we are relieved of some of these difficulties.
2. Sometimes performing the necessary operations in debug mode In the process of step-by-step debugging (for example, in Visual Studio) we can move the current point of the program execution, including we can move it inside the never-executed if block. ')
Why this may be needed? Well, here are a couple of options:
In this block, you can make some extra-heavy logging (well, for example, a dump of the entire memory). In the normal mode (and even in the debag configuration), we do not need this, but sometimes, during the debugging of a hard place, it may be necessary. Wrap this dump in if (false) and at the right moment jump inside it, then back.
In the course of the same debugging, we need to transfer the object to a certain reference state for the test. Moreover, we don’t need it either in the release or in the debug - only now for debugging. Plus, perhaps in the future - if problems arise. We wrap the object's initialization in if (false) - this guarantees us the presence of code in the program and at the right moment we transfer the execution inside.
Thus, we get a code that will never be called by the program itself, but to which we can, if desired, be able to “jump” in the course of debugging.