为什么建议在源文件的末尾使用空行? [英] Why is it recommended to have empty line in the end of a source file?

查看:134
本文介绍了为什么建议在源文件的末尾使用空行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一些代码样式工具推荐这样做,我记得看到一些UNIX命令行工具警告缺少空行.

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 empty line?

推荐答案

如果文本文件中的最后一行数据未以换行符或回车/新行组合终止,则许多较旧的工具行为不当.他们会忽略该行,因为它以^ Z(eof)终止.

Many older tools misbehave if the last line of data in a text file is not terminated with a newline or carriage return / new line combination. They ignore that line as it is terminated with ^Z (eof) instead.

这篇关于为什么建议在源文件的末尾使用空行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆