Re: EXIT SECTION/PARAGRAPH
- From: docdwarf@xxxxxxxxx ()
- Date: Sat, 8 Sep 2007 11:52:47 +0000 (UTC)
In article <gq54e3tujvakviekt9uklks3hv2vlracur@xxxxxxx>,
Robert <no@xxxxxx> wrote:
On Fri, 7 Sep 2007 12:59:30 -0400, "Rick Smith" <ricksmith@xxxxxxx> wrote:
Note that, if declaratives are used and there is only
one section for the body of the procedure division,
EXIT SECTION will transfer control to the end of
that section as required by 2002, EXIT statement
GR(12). This will, in effect, transfer control to the
explicit GOBACK statement that occurs at the end
of the source element, as described in 2002, 14.5.3,
last paragraph.
Old School Cobol programmers have an almost genetic belief that the last
line of a program
must be its exit. I've seen this structure thousands of times:
procedure division.
main-line. *> non-functional paragraph name
perform beginning-of-program
perform middle-of-program
perform end-of-program.
....
end-of-program.
goback.
* --- last line in source code ---
Why don't they say GO TO end-of-program, or just say goback in main-line?
I barely know why *I* say things, Mr Wagner, let alone anyone else... but
many's the time I've been on a site where the standard was:
PROCEDURE DIVISION.
PERFORM 0000-HOUSKEEPING THRU 0000-EX.
PERFORM 3000-MAIN-LINE THRU 3000-EX.
PERFORM 9999-EOJ THRU 9999-EX.
GOBACK.
3000-MAIN-LINE. <== note 'out-of-sequence' numbering. The reason given
for this is that Housekeeping is done once and should be 'out of the way'
(farther down in the source), EOJ is at the end and, likewise, farther
down... and most problems occur in the mainline, so keep that more
convenient than the other paragraphs.
Why don't they understand that temporal cohesion is a poor way to
structure a program?
The way that a program's skeleton was put together, decades on back, just
might possibly not reflect the current programmers' understandings.
Cohesion is supposed to be functional.
Mr Wagner, this is not a world where, in my experience, 'supposed to be'
is actualised often enough that the lack of this occurring is worthy of
much note... perhaps our experiences are different.
Now that goback at the end is in the Standard, their instictive belief has been
vindicated. They'll cite it as proof they were Right all along.
As long as the checks clear the bank, Mr Wagner, a Real Programmer might
not see much more in 'what they cite' than noise.
DD
.
- Follow-Ups:
- Re: EXIT SECTION/PARAGRAPH
- From: Robert
- Re: EXIT SECTION/PARAGRAPH
- References:
- EXIT SECTION/PARAGRAPH
- From: Roger While
- Re: EXIT SECTION/PARAGRAPH
- From: Rick Smith
- Re: EXIT SECTION/PARAGRAPH
- From: Robert
- EXIT SECTION/PARAGRAPH
- Prev by Date: Re: Cobol Myth Busters
- Next by Date: Re: Can IT deal with change? was:
- Previous by thread: Re: EXIT SECTION/PARAGRAPH
- Next by thread: Re: EXIT SECTION/PARAGRAPH
- Index(es):
Relevant Pages
|