[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [open-cobol-list] Fixed vs Free Format
From: |
Andrew Pennebaker |
Subject: |
Re: [open-cobol-list] Fixed vs Free Format |
Date: |
Thu, 17 Nov 2011 16:12:07 -0500 |
Honest questions from a newbie:
- Does free format allow arbitrarily indented code like Ruby, or consistent indentation like Python, or farthest indentation like Haskell?
- Does free format allow extra whitespace?
Can we subsume fixed format into free and have the compiler encourage people to use free but never complain when we code in fixed?
Whitespace is a good way to visually separate components of a larger system. Since code proceeds line by line, vertical whitespace is a powerful way to make code more readable. Horizontal whitespace in the form of tabs and spaces helps to indicate nested blocks of code. I agree that whitespace makes code much more readable.
However, requiring seven spaces before each line of code is just silly. It adds no whitespace; it just shifts all code over. You might as well drag a text editor window over to the right; it's aesthetically identical and adds just as much "readability". I realize the historicity of the extra characters, but tradition /= good practice. We have text editors to show line numbers, so we don't need that column any more.
There is indeed the potential for breaking backwards compatibility, and for alienation of people who prefer the spurious spaces. But computers exist to automate; there's no technological reason that OpenCobol can't read a .cob file, decide for itself which format is being used, fixed or free, and run with it. One solution is to read the first line: If there are six spaces and a star, consider the file to be in fixed format. If there are no spaces, consider the file to be in free format. Or you could go so far as statistical analysis to determine which format is being used more often in a file, and inform the coder of the exceptions. There are myriad ways to make fixed and free coders happy, all without requiring flags or setting defaults.
Cheers,
Andrew Pennebaker
- [open-cobol-list] Fixed vs Free Format, Andrew Pennebaker, 2011/11/17
- Re: [open-cobol-list] Fixed vs Free Format, john Culleton, 2011/11/17
- Re: [open-cobol-list] Fixed vs Free Format,
Andrew Pennebaker <=
- Re: [open-cobol-list] Fixed vs Free Format, vince, 2011/11/17
- Re: [open-cobol-list] Fixed vs Free Format, Brian Tiffin, 2011/11/17
- Re: [open-cobol-list] Fixed vs Free Format, john Culleton, 2011/11/17
- Re: [open-cobol-list] Fixed vs Free Format, Andrew Pennebaker, 2011/11/18
- Re: [open-cobol-list] Fixed vs Free Format, john Culleton, 2011/11/18
Re: [open-cobol-list] Fixed vs Free Format, vince, 2011/11/17