What's the reason for leaving an extra blank line at the end of a code file?

Posted by Lord Torgamus on Stack Overflow See other posts from Stack Overflow or by Lord Torgamus
Published on 2010-03-08T15:56:03Z Indexed on 2010/03/28 0:43 UTC
Read the original article Hit count: 313

Eclipse and MyEclipse create new Java files with an extra blank line after the last closing brace by default. I think CodeWarrior did the same thing a few years back, and that some people leave such blank lines in their code either by intention or laziness. So, this seems to be at least a moderately widespread behavior.

As a former human language editor -- copy editing newspapers, mostly -- I find that those lines look like sloppiness or accidents, and I can't think of a reason to leave them in source files. I know they don't affect compilation in C-style languages, including Java. Are there benefits to having those lines, and if so, what are they?

© Stack Overflow or respective owner

Related posts about language-agnostic

Related posts about coding-style