为什么在Fortran Standard中最大单行长度限制为132个字符? [英] why is maximum single-line length limited to 132 characters in Fortran Standard?

查看:516
本文介绍了为什么在Fortran Standard中最大单行长度限制为132个字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这与性能,干净的源代码,编译器有关吗...?我知道许多编译器允许更长的单行代码.但是,如果可以在没有任何妥协的情况下进行此扩展,那么为什么Fortran标准严格遵守此规则?

Is it about performance, clean source code, compilers, ...? I know that many compilers allow longer single-line codes. But, if this extension is possible without any compromise, then why does Fortran standard strictly adhere to this rule?

我知道这是一个非常笼统的问题(stackoverflow警告我,考虑到其标题,该问题可能会被否决),但是我找不到任何能解释现代Fortran标准中最大132个字符的逻辑的资源.

I know that this is very general question (stackoverflow warns me that this question might be downvoted given its title), but I cannot find any resources that explain the logic behind a max length of 132 characters in modern Fortran standard.

更新至2019年10月22日:请参见 https://j3-fortran.org/doc/year/19/19-138r1.txt ,作为接受为Fortran标准的下一个202X修订版的工作项目的提案,该提案消除了最大行长和延续限制.

Update Oct 22, 2019: See https://j3-fortran.org/doc/year/19/19-138r1.txt for a proposal accepted as a work item for the next 202X revision of the Fortran standard, which eliminates the maximum line length and continuation limits.

推荐答案

看看规范:

ftp://ftp.nag.co.uk/sc22wg5/N001-N1100/N692.pdf

部分:3.3.1

这只是约定.有人认为132可以.在66版本中是72.

It's just convention. Somebody decided that 132 will be ok. In 66 version it was 72.

标准: https://gcc.gnu.org/wiki/GFortranStandards#Fortran_Standards_Documents

通常,这些限制(例如每行80、132个字符)由终端决定.

Usually, these limitations (like 80, 132 characters per line), were dictated by terminals.

仅以有趣"的方式说明如何在90年代编码;)

Just to illustrate, in a "funny" way, how was it to code in 90's ;)

这篇关于为什么在Fortran Standard中最大单行长度限制为132个字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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