Re: how do people feel about exit function from loop
- From: "Steve Gerrard" <mynamehere@xxxxxxxxxxx>
- Date: Sun, 29 Jul 2007 23:08:13 -0700
"Michael C" <nospam@xxxxxxxxxx> wrote in message
news:OLiqFbm0HHA.1164@xxxxxxxxxxxxxxxxxxxxxxx
"Robert Morley" <rmorley@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:eM%239lSm0HHA.5380@xxxxxxxxxxxxxxxxxxxxxxx
You know, I think you've gotten to the heart of why I don't like Exit For and
similar constructs, never mind that structured programming says you shouldn't
use them. Imagine a complex loop rendered into English:
For w. Exits
"For each of these items, I want you to do some things to them. Except if
you run across this. Oh, and also stop if you find something else. Or if
you run into any problems."
While/Until/etc.
"Unless you run across this, find something else, or run into any
problems, do some things to each of these items."
Actually the first seems MUCH more logical to me. Open all these boxes, stop
when you find the money. Just like the programming example it's much simpler
:-)
Michael
I think Robert has stumbled onto something here. Neither of the two sounds
particularly good when rendered into spoken English. It highlights the fact that
the loop in quesiton is inherently messy. The For w Exits starts off boldly,
then tacks on a list of lame excuses, sounding like a typical politician. The
second lists so many conditions first, you wonder if you will ever get to the
heart of the matter, making you think you are up against a career bureaucrat.
Neither the For loop nor the While loop exactly match the problem - what you
need is a new loop structure. Of course, then Michael would insist it be called
the For While loop, and Robert would demand it be called the While For loop, and
we would have to endure another long ping pong match - so nevermind. :)
.
- Follow-Ups:
- Re: how do people feel about exit function from loop
- From: Michael C
- Re: how do people feel about exit function from loop
- References:
- how do people feel about exit function from loop
- From: greg
- Re: how do people feel about exit function from loop
- From: Ken Halter
- Re: how do people feel about exit function from loop
- From: Jan Hyde (VB MVP)
- Re: how do people feel about exit function from loop
- From: Steve Gerrard
- Re: how do people feel about exit function from loop
- From: Michael C
- Re: how do people feel about exit function from loop
- From: Robert Morley
- Re: how do people feel about exit function from loop
- From: Michael C
- Re: how do people feel about exit function from loop
- From: Robert Morley
- Re: how do people feel about exit function from loop
- From: Michael C
- Re: how do people feel about exit function from loop
- From: Robert Morley
- Re: how do people feel about exit function from loop
- From: Michael C
- Re: how do people feel about exit function from loop
- From: Robert Morley
- Re: how do people feel about exit function from loop
- From: Michael C
- Re: how do people feel about exit function from loop
- From: Robert Morley
- Re: how do people feel about exit function from loop
- From: dNagel
- Re: how do people feel about exit function from loop
- From: Robert Morley
- Re: how do people feel about exit function from loop
- From: Michael C
- how do people feel about exit function from loop
- Prev by Date: Re: how do people feel about exit function from loop
- Next by Date: Re: how do people feel about exit function from loop
- Previous by thread: Re: how do people feel about exit function from loop
- Next by thread: Re: how do people feel about exit function from loop
- Index(es):
Relevant Pages
|