Re: Where are spaces required in COBOL source code?
- From: epc8@xxxxxxxx
- Date: 27 May 2005 14:06:38 -0700
Chuck Stevens wrote:
> Let's try that again. Things got messed up in the editing, and perhaps I
> was too abrupt.
>
> <epc8@xxxxxxxx> wrote in message
> news:1117154259.996313.163080@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>
> > The compiler ... requires a
> > variable name to be separated by at least one space from the
> > parentheses enclosing a subscript (or an expression denoting reference
> > modification). ...
>
[snip]
> > Please note that the first language I learned was FORTRAN using
> > fixed-form (punched card) format. There spaces are only meaningful
> > inside string literals.
>
> Getting as much as possible accomplished on a single line of source code
> used to be considered the hallmark of Expert Coding. This has passed out of
> favor -- even in languages where it is common like FORTRAN and ALGOL --
> because it's rarely very readable and often difficult to maintain. It's
> not just FORTRAN.
>
I was just explaining my background, not my preferences :-). When I
phrased the second part of the question I was thinking of the language
from the point of view of someone writing a parser for the language.
Somehow the questions I posed seemed more interesting at the time I
wrote them :-(.
Re: spaces required around colons in reference modification expression.
I am unable to reproduce this problem. Sorry.
[snip]
> The general stylistic rule for COBOL is that COBOL is based on English, in
> which letters are combined into words that are separated by spaces and
> punctuation marks. The punctuation rules are similar to those for English
> as well, including the frequent requirement that certain punctuation marks
> be followed by at least one space. Some specifics may have changed over
> time, but a separator space where it is allowed is
> rarely a Bad Idea in COBOL.
>
> What is considered readable code in COBOL generally bears a very close
> relationship to the rules of English punctuation. In that language,
> typically, at least one space follows a comma or period or semicolon, a
> parenthetical expression is separated from its preceding text by a space,
> and the contents of a parenthetical expression most often are adjacent to
> their enclosing parentheses. Such is the convention with COBOL.
>
> -Chuck Stevens
Thanks for a very considered, concise and literate description!
.
- References:
- Where are spaces required in COBOL source code?
- From: epc8
- Re: Where are spaces required in COBOL source code?
- From: Chuck Stevens
- Where are spaces required in COBOL source code?
- Prev by Date: Re: Where are spaces required in COBOL source code?
- Next by Date: Re: Where are spaces required in COBOL source code?
- Previous by thread: Re: Where are spaces required in COBOL source code?
- Next by thread: Re: Where are spaces required in COBOL source code?
- Index(es):
Relevant Pages
|
|