‹ BackHN Continuity

Thread

Anecdotally, programmers dislike "reduce"

175 points · 283 comments · vinhnx

  1. gg582 · · focus · HN ↗
    Some conventions are socially made... In C, some uses

    #if 0

        these_lines_are();
        not_executed();
    
    #endif

    but 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"

    1. draven · · focus · HN ↗
      My C is really rusty but aren't those different ? If using #if/#endif the compiler won't even see the comments.
      1. gg582 · · focus · HN ↗
        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 :)
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.