Visual Studio - blank line at the end of each new file

*爱你&永不变心* 提交于 2019-12-05 16:28:52

问题


Why does VS add a blank line at the end of each new file I create? I use VS to create .NET projects (not C++ or something).

Is there any special reason? Historical compatibility with compilers and parsers?

Can I disable this??


回答1:


It is recommended to have a blank line at the end of each file for navigability purposes. Think what happens if someone opens your code with vim for example and uses a keymap to jump from empty line to empty line. Or, if he decides to add another portion of code at the end of file he can quickly do a GO and enter it instead of having to scroll until the end of file.

Also, source control tools will report more changes if you don't have a trailing blank line when you try to insert code at the end of file.



来源:https://stackoverflow.com/questions/6690951/visual-studio-blank-line-at-the-end-of-each-new-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!