Suppose I have some code
void some_block(void)
{
some_statement_1();
some_statement_2();
some_statement_3();
}
Now I wish to out-comment statement #2, but here I never can find a way where it feels right. Usually I will do the following:
void some_block(void)
{
some_statement_1();
// some_statement_2();
some_statement_3();
}
But now we got what looks like extra indentation of statement #2, yet it is arguable whether the indentation is still "correct". Alternatively we could do:
void some_block(void)
{
some_statement_1();
//some_statement_2();
some_statement_3();
}
This looks a bit better, yet still somehow also wrong. However the following just looks misplaced:
void some_block(void)
{
some_statement_1();
//some_statement_2();
some_statement_3();
}
How do you outcomment code and keep "correct" indentation?
Update
It seems most people who have provided answers did not answer my question, but simply state that it is bad practice to leave dead code around. While I completely agree with that, that was not the point of the question.
Right now I am facing a case of example where I have 5 helper functions, that manage 5 similar but slightly different structs for me. I use these helper functions to make my code easier to read.
But, at the moment (and for the next month probably) one of the structs are not going to be used. And I cannot commit anything which causes compiler warnings, so I have to outcomment that part of the code and commit it like that.
Also I forgot this last variant, which I think just looks plain wrong:
void some_block(void)
{
some_statement_1();
// some_statement_2();
some_statement_3();
}