Re: ALTER design (Was: Code problems with Perform Thru Exit causes fall through)



On 5 Aug, 05:14, "Rick Smith" <ricksm...@xxxxxxx> wrote:
"Pete Dashwood" <dashw...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message

news:5hkgiaF3k84enU1@xxxxxxxxxxxxxxxxxxxxx







"Doug Miller" <spamb...@xxxxxxxxxx> wrote in message
news:J32ti.630$3x.597@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In article <1186227636.237724.32...@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Alistair <alist...@xxxxxxxxxxxxxxxxxxxxx> wrote:
[snip]
However, I have
met programmers who would have difficulty understanding a moderate
level of complex IF using NOT.

Yes, I have too -- and I've always thought that such folk were in the
wrong
line of work.

Yep. Me too...

Perhaps with such weaknesses as maintenance programmers,
their new line of work should be new program development.
In that position, they might keep the knots, ... er NOTs, out
of future code. <g>

Seriously, consider the problem of general exclusionary rules.
Such rules state, in effect, that a particular action is not to be
taken; but those rules, over time, may come to have exceptions.
From a program maintenance standpoint, having somewhere to
place those exceptions seems worthwhile.

if general-exclusionary-rule
continue
else
perform default-action
end-if

The 'continue' statement is the placeholder for the inevitable
exceptions to the general rule. When exceptions need to be
added to the code, the 'continue' is replaced with the necessary
tests.

perform tests-for-exception
if exception-to-general-rule
perform default-action
end-if

If the original code is written with a 'not',

if not general-exclusionary-rule
perform default-action
end-if

The tendency might be to begin stacking one exception after
another into the 'if' condition; thus leading to a maintenance
nightmare.

if (not general-exclusionary-rule)
or (1st-exception)
or (2d-exception)
or (...)
or (nth-exception)
perform default-action
end-if

In this case, one might say (and I will): When a general
exclusionary rule is present, use 'continue' instead of 'not'
as an exception to the general exclusionary rule, "Use 'not'
instead of 'continue'". <g>- Hide quoted text -


Sound argument and I agree (that's two posts in one night to which I
agree).


.



Relevant Pages

  • Re: ALTER design (Was: Code problems with Perform Thru Exit causes fall through)
    ... Perhaps with such weaknesses as maintenance programmers, ... but those rules, over time, may come to have exceptions. ... if not general-exclusionary-rule ... exclusionary rule is present, ...
    (comp.lang.cobol)
  • Re: Cobol work?
    ... Consider the common Cobol-only idiom: ... normal path through the code is clear. ... that the exceptions do not obscure the normal path ... Most experienced programmers would avoid code like ...
    (comp.lang.cobol)
  • Re: Cobol work?
    ... Here is what Steve McConnell, ... >> normal path through the code is clear. ... >> that the exceptions do not obscure the normal path ... >> exceptional programmers, for whom clarity is more important ...
    (comp.lang.cobol)
  • Re: help this confused C++ newbie(long post!!)
    ... overloading, then move on to templates, then on to exceptions, and so on. ... Second Edition" by Scott Meyers ... Java programmers who migrate to C++... ...
    (comp.lang.cpp)
  • Re: Cobol work?
    ... >> This is a code style that only a Cobol programmer could love...and it ... > normal path through the code is clear. ... > that the exceptions do not obscure the normal path ... > 'some experienced programmers would not avoid' (ignoring ...
    (comp.lang.cobol)