Re: Infinite Loops and Explicit Exits
From: Robert Wagner (spamblocker-robert_at_wagner.net)
Date: 11/04/04
- Next message: Robert Wagner: "Re: Infinite Loops and Explicit Exits"
- Previous message: Robert Wagner: "Re: Infinite Loops and Explicit Exits"
- In reply to: Chuck Stevens: "Re: Infinite Loops and Explicit Exits"
- Next in thread: Howard Brazee: "Re: Infinite Loops and Explicit Exits"
- Reply: Howard Brazee: "Re: Infinite Loops and Explicit Exits"
- Reply: Chuck Stevens: "Re: Infinite Loops and Explicit Exits"
- Reply: Chuck Stevens: "Re: Infinite Loops and Explicit Exits"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 04 Nov 2004 01:23:59 GMT
On Wed, 3 Nov 2004 08:12:27 -0800, "Chuck Stevens"
<charles.stevens@unisys.com> wrote:
>
>"Robert Wagner" <spamblocker-robert@wagner.net> wrote in message
>news:qr6go0tqvutkqbtuji7q0919s8j22plnl2@4ax.com...
>> PERFORM FOREVER doesn't exist yet, and do-it-yourself methods are
>> uncommon.
>
>The methods are neither common nor uncommon. What is relevant is whether
>they exist today or not, and whether they are straightforward or not, and I
>believe the answer to both of those is "yes". Now, if what you meant by
>"uncommon" was "not commonly used", that's a matter of personal style and of
>your exposure to it. I suspect the most straightforward method -- an
>88-level item referencing an invariant filler -- isn't that common precisely
>because many practicing programmers seem to avoid 88-level items to begin
>with (despite the continued enhancement to the feature in the various
>standards).
I haven't noticed avoidance of 88s.
Use of PERFORM .. FOREVER is uncommon because the standard doesn't
provide a mechanism to stop iterations in an out-of-line perform.
>> There is no need for THRU A-EXIT *now*,
>
>Depends on whether The Person Paying Your Salary wants it there -- or wants
>it to stay there, even if it's for the simple reason that he wants it there
>and he wants it to stay there.
Wants and Pays do not speak with a single voice.
The Person Paying My Salary is an executive who knows nothing about
programming style. If asked, he'd champion the style with lowest
maintenance cost and highest reliability, without regard for shop
traditions.
The person enforcing shop standards is a supervisor whose motivation
is job security, not money.
>> and the terminating condition
>> belongs on UNTIL rather than embedded in the procedure.
>
>So the Dijkstra-inspired "DO FOREVER ... IF <condition> THEN UNDO ...END" is
>completely wrong-headed?
It's unfamiliar to Cobol programmers because the equivalent to UNDO --
EXIT PERFORM -- can only be used with in-line PERFORM. We want the
option to convert in-line to out-of-line when it becomes unwieldy. We
avoid EXIT PERFORM because it removes that option.
>So the appropriate response of a successful and profitable business, when
>some outsider says "your programming standards are hopelessly unfashionable"
>is "yessir, yessir, whatever you say sir. How many years of unprofitability
>are we going to have to go through to rectify this heinous crime?" ???
A straw man argument. You haven't shown there would be years of
unprofitability. I cited one case where savings were realized the
first year. I could have cited at least four others.
>> A properly structured program has no need for premature exits (except
>> to abort). The audience for EXIT PERFORM is programmers who don't know
>> how to do structured programming. For them, EXIT PERFORM is an
>> improvement over PERFORM A THRU A-EXIT.
>
>Again, Mr. Wagner: we just received a trouble report from a large customer
>that turns out to have been a problem with the ALTER verb. The bug was
>preventing this customer from upgrading to new system software because the
>program, which has clearly (from internal evidence) been performing to the
>customer's satisfaction for something on the order of twenty years or more,
>no longer works correctly.
I say EXIT PERFORM would be an improvement for unstructured programs;
your response talks about seriously unstructured code still in
production. How does the response disprove the assertion? It sounds
like an example supporting the assertion. If the customer upgrades to
2002, it will have to rewrite ALTER one way or another. EXIT PERFORM
might well be the least intrusive translation.
>It is not the business of the *standards* committee to decide whether a
>program is "properly structured" or not. Nor is it the business of the
>*compiler vendor* to decide that. It is the *customer's* job to decide
>that -- or to care, or not to care.
I agree that quality is not the concern of the standards committee nor
compiler vendor, but it is a valid concern of this forum. Posters here
can legitimately criticize ALTER, GO TO and PERFORM THRU. Readers who
care about quality might learn to program better. Reactionaries will
continue writing bad code.
- Next message: Robert Wagner: "Re: Infinite Loops and Explicit Exits"
- Previous message: Robert Wagner: "Re: Infinite Loops and Explicit Exits"
- In reply to: Chuck Stevens: "Re: Infinite Loops and Explicit Exits"
- Next in thread: Howard Brazee: "Re: Infinite Loops and Explicit Exits"
- Reply: Howard Brazee: "Re: Infinite Loops and Explicit Exits"
- Reply: Chuck Stevens: "Re: Infinite Loops and Explicit Exits"
- Reply: Chuck Stevens: "Re: Infinite Loops and Explicit Exits"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|