If you replace or delete a part of the program but want to keep the old code around for future reference, you often cannot simply comment it out. Block comments do not nest, so the first comment inside the old code will end the commenting-out. The probable result is a flood of syntax errors.
One way to avoid this problem is to use an always-false conditional instead. For instance, put
before the deleted code and
after it. This works even if the code being turned off contains conditionals, but they must be entire conditionals (balanced ‘
’ and ‘
Some people use
instead. This is risky, because
might be accidentally defined as a macro, and then the conditional would succeed.
can be counted on to fail.
Do not use
for comments which are not C code. Use a real comment, instead. The interior of
must consist of complete tokens; in particular, single-quote characters must balance. Comments often contain unbalanced single-quote characters (known in English as apostrophes). These confuse
. They don't confuse ‘