This was the case with Fortran 77 too, and for the same reason (punch cards). But modern Fortran (F90 through F2018) no longer requires formatting by column.
Re:The Beauty of COBOL (2018)
by YeGoblynQueenne on Friday October 18, 2019 @10:15AM
(#21291524)
Good point. I think maybe one reason is that COBOL is valued for its consistency, with the same code often running on modern machines that was written 50 years ago or so (at least that was the received wisdom when I was working at a COBOL shop). Perhaps the same is not the case with FORTRAN?
Re:The Beauty of COBOL (2018)
by Lt_Riza_Hawkeye on Friday October 18, 2019 @10:18AM
(#21291558)
>>It still is
It is not if you use free source format, which most new cobol programming is done in. Fixed source format does require the columns specifically, free source format lets you start wherever on the line you want, and extend for however long of a line you would like, but comments start with *>
So offsides syntax errors like Python. But immutable instead of arbitrarily dependent on context. Seems simpler and more modular to be able to look at a line of code and determine if the whitespace is correct.
It still is. Which column (not row) a statement starts in matters and it's a syntax error to start the wrong statement in the wrong column. Sorry I don't remember any specific examples because it's been a few years since I last used COBOL.
I remember hearing that this had something to do with how the early COBOL programs were encoded on punched cards. Anyway there was some practical aspect to it that is now not an issue anymore with the changes to hardware.