LF at the End of File
Why using this rule in 2014?
Are you still making one large js file with cat?
First of all, a whole bunch of unix utils rely upon the fact that every line in a text file ends with newline. Second, some editors inserts last newline automatically, so you may accidentally become author of the last line. This rule has the very same meaning as not BOM rule, UTF8 as an encoding and prohibition of trailing whitespaces: keep project files in a uniform and most portable way.
What are those UNIX tools? If we say we need portability, then why LF not CR LF?
What are those UNIX tools?
Mainly, editors: they just add last newline on saving a file (and you'll become the author of the last line). According to POSIX in Unix-like systems text file is the one with newlines at the end of every line, including last line. Otherwise a program has every right to treat a file as a binary one.
If we say we need portability, then why LF not CR LF?
CR LF is Win-only, whereas LF is for everything else we actually use. Majority wins.
What's the problem with being an author of empty line? And why state this in a codestyle?
Not empty but the last one, which can be meaningful.
Meaningful to people? How?
You know you can write code and the last line of a file? :)
I don't understand.
I don't want to argue about this anymore. There is an implication from POSIX, which may or may not be strictly necessary, and since we mostly use POSIX-compliant tools I suggest this rule continues to live. There is no any reason whatsoever to change this, only nasty little repercussions.
We live without this rule, and everything is fine. Problem is greatly exaggerated, no contemporary tool gives any damn to absence of blank line.
Again, what about ones adding the last newline?
See no problem with them (== with being an author of blank line).
It's not just that: you may accidentally commit files you haven't actually changed.
Does this impose any problem?
I believe it does. SCMs are not only for ability to revert some changes, they're also able to provide sometimes crucial info about a piece of code. Thus checking in unrelated crap is not exactly desired.
git blame and svn blame provide information regarding every single line, so you wouldn't have problem with unrelated crap.
You do understand that would be informational noise which would not ease an investigation.
Requirement to add LFs to all files makes much more noise.
No, it's not. One in a lifetime setting to your editor.
Nope. As you mentioned, there are tons of different tools, some of them add LF, and some do not.