• @ulterno@programming.dev
    link
    fedilink
    English
    01 month 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
        link
        fedilink
        0
        edit-2
        1 month 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