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: vince
Subject: Re: [open-cobol-list] Fixed vs Free Format
Date: Thu, 17 Nov 2011 21:23:12 +0000
User-agent: KMail/1.13.5 (Linux/2.6.33.7-server-2mnb; KDE/4.4.5; i686; ; )

Hi;
On Thursday 17 Nov 2011 21:12:07 Andrew Pennebaker 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?

Free format is just that you can have as much or as little spaces in the 
source, both before and in between words
> 
> Can we subsume fixed format into free and have the compiler
> *encourage*people to use free but never complain when we code in
> fixed?

Nope, the compiler needs to know what form you are using as in fixed the 
format usage is specific as is constantly being tested but it is very easy to 
convert a fixed into a free format using something like kate as the editor.
 
> 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.

Even in fixed there is a reasonable amount of flexibility in using spaces 
between words as well as between lines.

They are just ignored by the compiler. In fact the compiler make a first pass 
by changing format for internal processing to free and processing all copy 
statements including inline all code before parsing. This really applies to 
all compilers.



reply via email to

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