Why is it recommended to have empty line in the end of a source file?

后端 未结 8 896
独厮守ぢ
独厮守ぢ 2020-12-02 04:44

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

8条回答
  •  不知归路
    2020-12-02 05:36

    Apart from the fact that it is a nicer cursor position when you move to the end of a file in a text editor.

    Having a newline at the end of the file provides a simple check that the file has not been truncated.

提交回复
热议问题