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

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

问题描述

一些代码风格工具推荐这个,我记得看到一些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天全站免登陆