Re: "Continue& quot; usage
Nick Keighley wrote:
I don't think that's a fair criticism; I thought Richard's
`complexConditi onNotMatched` was a standin for whatever
expression was required, with the `Not` showing intent,
not the actual presence of a `Not` in the name.
I think there are subsequent studies in that direction, but I
don't have a cite to hand. One of my rantettes is against languages
that don't have an `unless`.
--
'It changed the future .. and it changed us.' /Babylon 5/
Hewlett-Packard Limited registered office: Cain Road, Bracknell,
registered no: 690597 England Berks RG12 1HN
Nick Keighley wrote:
is clearer. For a start it avoids an inverted test.
I don't write predicates with "not" in the name.
I don't write predicates with "not" in the name.
`complexConditi onNotMatched` was a standin for whatever
expression was required, with the `Not` showing intent,
not the actual presence of a `Not` in the name.
So
I would have coded your original example as
>
while(n--){
if (!complexCondit ionMatched(n))
continue; /* not interested. Check the next if there is one. */
>
/*do processing of things we are interested in*/
}
>
there is some evidence (if forced to cite I'll try "The Psychology
of Computer Programming") that human beings (including computer
programnmers) prefer positive to negative logic.
I would have coded your original example as
>
while(n--){
if (!complexCondit ionMatched(n))
continue; /* not interested. Check the next if there is one. */
>
/*do processing of things we are interested in*/
}
>
there is some evidence (if forced to cite I'll try "The Psychology
of Computer Programming") that human beings (including computer
programnmers) prefer positive to negative logic.
don't have a cite to hand. One of my rantettes is against languages
that don't have an `unless`.
--
'It changed the future .. and it changed us.' /Babylon 5/
Hewlett-Packard Limited registered office: Cain Road, Bracknell,
registered no: 690597 England Berks RG12 1HN
Comment