Skip to content

Instantly share code, notes, and snippets.

View annhienktuit's full-sized avatar
💭
newbie

Nhien Nguyen annhienktuit

💭
newbie
  • Grab
  • Vietnam
View GitHub Profile
@annhienktuit
annhienktuit / why-newline.md
Created July 19, 2024 10:53 — forked from OleksiyRudenko/why-newline.md
Why should text files end with a newline?

Why should text files end with a newline?

Reasons:

  • UNIX standard
  • If the last line in a file doesn't end with a newline then addition of next line affects two lines instead of one. This also pollutes diff on multiple files, so reader may wonder what has changed in a line whereas no significant change has occured.

Multiple newlines at the file end are also redundant as well as spaces at the end of line.