Re: COBOL ain't quite dead - yet !



On 29 Oct 2008 19:29:37 GMT, billg999@xxxxxxxxxxx (Bill Gunshannon)
wrote:


What advantage is this in either performing AAA or PERFORM
AAA-PARAGRAPH THRU AAA-EXIT?

I thought that question was answered in the next parpagraph.

And I didn't, so I asked again. It's much clearer to me to do:
PERFORM AAA
or even PERFORM AAA-PARAGRAPH THRU AAA-EXIT
than
PERFORM AAA THRU AAA-EXIT.
with
AAA.
AAA-PARAGRAPH.
....
AAA-EXIT.


I can't see what might be considered detrimental to it. I think it makes
the code easier for humans to read as blocks are more plainly delineated.
And the compiler probably doesn't care one way or the other. :-)

bill


The logic doesn't make sense to me. Compilers do understand it, but
it's very much like dangerous loops where performed THRU code performs
itself.

The way I see it (and how it was explained way back when) the two seperate
paragraphs create a block (akin to the BEGIN and END in Pascal procedures.)
As I said, the compiler don't care but humans can see at a glance where a
particular block of code begins and ends. And, if the you were actually
following the other rules of "Structured COBOL" the functions of your
program would be broken down into well delineated tasks with each task
being handled by it's paragraph. All of it in a top down structured tree.
And this would match and follow your flowchart in every detail. Oh wait,
they don't use them anymore either, :-) I see no way that using an EXIT
paragraph is going to result in a loop without it being pretty obvious
to the programmer.

But confusing sections and paragraphs is less obvious. Either
perform sections, or groups of paragraphs, not groups of hybrid
sections and paragraphs.

(although I prefer to perform paragraphs - that really is a different
topic).

--
"In no part of the constitution is more wisdom to be found,
than in the clause which confides the question of war or peace
to the legislature, and not to the executive department."

- James Madison
.



Relevant Pages

  • Re: R: GOBACK (was: Perform Thru/Go to vs. Perform - Compile Speed
    ... >>in a toy program using a single compiler on just one platform. ... and ANS'2002 and not to something that _isn't_ 'modernized Cobol'. ... > existing Cobol program to run paragraphs in parallel requires changing at least ... > one paragraph name to ENTRY, or breaking the program into smaller ones. ...
    (comp.lang.cobol)
  • Re: Cobol work?
    ... >> l.willms@xxxxxxxxxxx (Lueko Willms) wrote: ... >>> For the human reader it might make no difference if the contents of ... I do rather regret that the named comment paragraphs have been ... On what compiler did DATE-COMPILED have to be updated manually? ...
    (comp.lang.cobol)
  • Re: Bad habits of GOTO-using programmers
    ... each label to determine what to do - ignore the label ... I suppose an optimizing compiler could determine when code won't drop ... It cannot be used if the program contains -EXIT paragraphs. ... STOP RUN or GOBACK cannot fall out the bottom. ...
    (comp.lang.cobol)