gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [open-cobol-list] Fixed vs Free Format


From: john Culleton
Subject: Re: [open-cobol-list] Fixed vs Free Format
Date: Thu, 17 Nov 2011 17:52:03 -0500

On Thu, 17 Nov 2011 16:12:07 -0500
Andrew Pennebaker <address@hidden> wrote:

> 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.

Actually it is useful to have line numbers for error messages.
And it is also useful for the printed output to show all the COPYed code
in the printout. OC errs in this respect. 

But above all COBOL is supposed to be readable and
understandable to programmers other than the one who wrote it.
Indeed even the original programmer may have problems dealing
with a program he wrote 6 months ago. 

Part of my COBOL toolkit is a program that renumbers all the
lines of the program. I just leave off the leading zeros. They
don't add to readability. And I use upper and lower case. We
aren't dealing with that hardware limitation any more. 

I also use the traditional paragraphs in the IDENTIFICATION
DIVISION. That is part of the wisdom of Grace Murray Hopper that
later and lesser minds have discarded.


-- 
John Culleton
Free list of books for self-publishers:
http://wexfordpress.net/shortlist.html

"Create Book Covers with Scribus"
http://www.booklocker.com/books/4055.html


reply via email to

[Prev in Thread] Current Thread [Next in Thread]