fortran

why is maximum single-line length limited to 132 characters in Fortran Standard?


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?

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.

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.

Update July 31, 2024: The 2023 Fortran Standard has now revised the line length and statement limits to the following in free source form:


Solution

  • Take a look at specification:

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

    section: 3.3.1

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

    Standards: https://gcc.gnu.org/wiki/GFortranStandards#Fortran_Standards_Documents

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

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

    enter image description here