Re: ALTER design (Was: Code problems with Perform Thru Exit causes fall through)
- From: Alistair <alistair@xxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 06 Aug 2007 16:45:43 -0700
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[snip]
news:J32ti.630$3x.597@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In article <1186227636.237724.32...@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Alistair <alist...@xxxxxxxxxxxxxxxxxxxxx> wrote:
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).
.
- References:
- Re: ALTER design (Was: Code problems with Perform Thru Exit causes fall through)
- From: Pete Dashwood
- Re: ALTER design (Was: Code problems with Perform Thru Exit causes fall through)
- From:
- Re: ALTER design (Was: Code problems with Perform Thru Exit causes fall through)
- From: Alistair
- Re: ALTER design (Was: Code problems with Perform Thru Exit causes fall through)
- From:
- Re: ALTER design (Was: Code problems with Perform Thru Exit causes fall through)
- From: Alistair
- Re: ALTER design (Was: Code problems with Perform Thru Exit causes fall through)
- From: Doug Miller
- Re: ALTER design (Was: Code problems with Perform Thru Exit causes fall through)
- From: Alistair
- Re: ALTER design (Was: Code problems with Perform Thru Exit causes fall through)
- From: Doug Miller
- Re: ALTER design (Was: Code problems with Perform Thru Exit causes fall through)
- From: Pete Dashwood
- Re: ALTER design (Was: Code problems with Perform Thru Exit causes fall through)
- From: Rick Smith
- Re: ALTER design (Was: Code problems with Perform Thru Exit causes fall through)
- Prev by Date: Re: ALTER design (Was: Code problems with Perform Thru Exit causes fall through)
- Next by Date: Re: Laugh-Generating Situations
- Previous by thread: Re: ALTER design (Was: Code problems with Perform Thru Exit causes fall through)
- Next by thread: Re: ALTER design (Was: Code problems with Perform Thru Exit causes fall through)
- Index(es):
Relevant Pages
|