Why should text files end with a newline?

后端 未结 18 1128
栀梦
栀梦 2020-11-21 22:56

I assume everyone here is familiar with the adage that all text files should end with a newline. I\'ve known of this \"rule\" for years but I\'ve always wondered — why?

18条回答
  •  有刺的猬
    2020-11-21 23:35

    IMHO, it's a matter of personal style and opinion.

    In olden days, I didn't put that newline. A character saved means more speed through that 14.4K modem.

    Later, I put that newline so that it's easier to select the final line using shift+downarrow.

提交回复
热议问题