• nogooduser@lemmy.world
    link
    fedilink
    English
    arrow-up
    12
    ·
    1 month ago

    I used to work on an old DOS product and we didn’t have a debugger so we used to have a DEBUG command line argument with

    if (DEBUG) printf(“debugging”);
    

    to try to see what was happening and the number of times that code alone fixed the problem was scary.

    • psycho_driver@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      1 month ago

      I mean . . . I still do this on my own stuff. If I’m interested in optimizing for speed I’ll do it as #ifdef instead of if ()