Re: Help! GO TO and PERFORM THRU!
- From: "Pete Dashwood" <dashwood@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 6 Mar 2007 12:24:03 +1300
"Frank Swarbrick" <Frank.Swarbrick@xxxxxxxxxxxxxx> wrote in message
news:553380F236v7tU1@xxxxxxxxxxxxxxxxxxxxx
Charles Hottel<chottel@xxxxxxxxxxxxx> 03/03/07 7:24 PM >>>Gosh! you mean like LX-1 and myself suggested 3 days ago in this thread?
"Pete Dashwood" <dashwood@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:54p7lrF21d53dU1@xxxxxxxxxxxxxxxxxxxxx
"Howard Brazee" <howard@xxxxxxxxxx> wrote in message
news:qjrdu2172daq1ae22ebqnn7r6uiki905g1@xxxxxxxxxx
On Thu, 1 Mar 2007 12:15:37 +1300, "Pete Dashwood"
<dashwood@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I couldn't disagree more.
About the flag or the style mix :-)?
I like full stop periods within paragraphs - and always use END-IFs
with my IFs.
Fair enough. A personal preference.
As you may have gathered, I disagree. I think periods were a major cause
great.of error in "old" COBOL and the fewer you have of them, the better. The
only requirement now (in the Procedure Division...) seems to be
immediately preceding a paragraph/section name and I reckon that is
Why would I prefer fewer periods (full stops)...?
1. With some of the old impact printers they didn't render properly and
were easily missed. Sure, that is much less of a problem these days when
we print listings with laser printers, but I have lingering suspicions
of
realany program listing. Fortunately, I never use COBOL listings these days
and haven't for many years... Still, reducing the periods reduces any
or imagined risk and makes me feel better :-).
2. Using an end-of-statement terminator (full stop) (which is small and
easily missed) rather than a scope delimiter (which is easily visible
and
prone.logically sensible) makes cutting and pasting code much more error
3. Using both scope delimiters and full stops just seems ugly and
unnecessary to me.
I think using END-IF is a step in the right direction, but why not take
a
youfew more steps and use ALL of the scope delimiters? Before you know it
are thinking in logical scope blocks (just as you would in a modern
language), and periods are just an ugly irrelevance in the middle of
your
havecode... :-)
Pete.
There are many ways to write a nested IF statement. Here is one style I
seen (with the ending left unfinished):
IF
stmts
ELSE IF
stmts
ELSE IF
stmts
ELSE IF
stmts
ELSE IF
stmts
How would you choose to end something like this?
1. You could just put a period at the end of the last statement in the
last
ELSE IF.
2. You could code END-IF with a period.
3. You could code an END-IF for each IF all on one line, with or without a
period after the last one. The more IFs the more chance of getting it
wrong
and the harder it will be to read. Of course the IBM mainframe compiler
shows you a nesting level number to aid in this type of thing.
4. You could use EVALUATE instead.
EVALUATE TRUE
WHEN ...
stmts
WHEN ...
stmts
WHEN ...
stmts
WHEN ...
stmts
WHEN ...
stmts
END-EVALUATE
Frank
There has been a whole debate sparked by this... We moved from using
EVALUATE to whether or not you should agree to perpetuate bad practice. You
really must keep up, Frank... :-)
Pete.
.
- Follow-Ups:
- Re: Help! GO TO and PERFORM THRU!
- From: Frank Swarbrick
- Re: Help! GO TO and PERFORM THRU!
- From: LX-i
- Re: Help! GO TO and PERFORM THRU!
- References:
- Re: Help! GO TO and PERFORM THRU!
- From: Pete Dashwood
- Re: Help! GO TO and PERFORM THRU!
- From: Howard Brazee
- Re: Help! GO TO and PERFORM THRU!
- From: Pete Dashwood
- Re: Help! GO TO and PERFORM THRU!
- From: Charles Hottel
- Re: Help! GO TO and PERFORM THRU!
- From: Frank Swarbrick
- Re: Help! GO TO and PERFORM THRU!
- Prev by Date: Re: Help! GO TO and PERFORM THRU!
- Next by Date: Re: FUNCTION's LOCALE-(DATE/TIME)
- Previous by thread: Re: Help! GO TO and PERFORM THRU!
- Next by thread: Re: Help! GO TO and PERFORM THRU!
- Index(es):
Relevant Pages
|