Some code style tools recommend this and I remember seeing some unix command line tools warning about missing empty line.
What is the reasoning for having an extra e
Some languages define their input file in terms of input lines, where each input line is a series of characters terminated by a carriage return. If their grammar is so defined, then the last valid line of the file must be terminated by a carriage return too.
An argument can also be made for cleaner diffs if you append to the file following the same reasoning as Why are trailing commas allowed in a list?
The following is copied (and trimmed a bit) from the linked resource:
Changing:
s = [
'manny',
'jack',
]
to:
s = [
'manny',
'jack',
'roger',
]
involves only a one-line change in the diff:
s = [
'manny',
'jack',
+ 'roger',
]
This beats the more confusing multi-line diff when the trailing comma was omitted:
s = [
'manny',
- 'jack'
+ 'jack',
+ 'roger'
]