Re: how do people feel about exit function from loop
- From: "Michael C" <nospam@xxxxxxxxxx>
- Date: Tue, 24 Jul 2007 14:28:56 +1000
"greg" <greg@xxxxxxxxxx> wrote in message
news:%23jsxyFXzHHA.4844@xxxxxxxxxxxxxxxxxxxxxxx
In general,
How do people feel about using exit function from inside of a loop?
Is it bad practice?
So for example. The same code written 2 ways. Is the #1 bad code?
thanks
Here we go again. :-) To add to what other's have said, quite often exit for
or exit function is considered bad because it is likened to Goto. Yes, Goto
is bad but it is bad because it has the ability to ENTER a loop when it
shouldn't. It is not really considered as bad if it is used to to exit a
loop.
I would also repeat what other's have said, that if you find yourself making
code more complicated and less readable to avoid an exit for or exit
function (like you have here) then should should probably reconsider. Number
2 is significantly less readable.
Michaek
.
- Follow-Ups:
- Re: how do people feel about exit function from loop
- From: Robert Morley
- Re: how do people feel about exit function from loop
- References:
- Prev by Date: Re: Calling name_Click()?
- Next by Date: Re: Singles to Doubles
- 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
|
Loading