• ulterno@programming.dev
    link
    fedilink
    English
    arrow-up
    0
    ·
    18 days ago

    Simple. \n when you just want a newline.
    println when you need to flush at the moment.

    Useful in case you are printing a debug output right before some function that might do bed stuff to buffers.

      • pelya@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        17 days ago

        It depends on whether you are printing to a terminal or to a file (and yes the terminal is also a file), and even then you can control the flushing behaviour using something like unbuffer