Some conventions are socially made... In C, some uses#if 0 these_lines_are(); not_executed(); #endifbut most of the cases people just use/* comments* these_lines_are();* not_executed();** end comment */Then, why?#if 0#endiflooks clear and it definitely says how a computer skips many lines.But we just don't use it because it implies low-level knowledge "that every C developers have"
My C is really rusty but aren't those different ? If using #if/#endif the compiler won't even see the comments.
Yep that's right. Using #if/#endif excludes whole lines(so compiler won't see any lines). And this difference can prevent when struggling with nested comments :)
gg582 · · focus · HN ↗
#if 0
#endifbut most of the cases people just use
/* comments
* these_lines_are();
* not_executed();
*
* end comment */
Then, why?
#if 0
#endif
looks clear and it definitely says how a computer skips many lines.
But we just don't use it because it implies low-level knowledge "that every C developers have"
draven · · focus · HN ↗
gg582 · · focus · HN ↗