4 ms·
Yes, I think you didn't understand. The question was "why". If newline characters (hypothetically) separated lines rather than terminated them, like how commas
by bloak 6y ago
Yes, I think you didn't understand. The question was "why". If newline characters (hypothetically) separated lines rather than terminated them, like how commas separate fields in some situations rather than terminate them, then, in that hypothetical situation, you would not be able to distinguish zero lines from one empty line. This may not be the historical reason for non-empty files ending with a newline, but it's a motivation for that rule.
In most of the cases where commas separate things either those things are not allowed to be empty or there has to be at least one thing, so there's no problem. But you have to watch out for cases in which you don't have those conditions because then you get the ambiguity.