Re: what does two semicolns ';;' do
- From: Michael Fesser <netizen@xxxxxx>
- Date: Mon, 30 Jun 2008 14:29:30 +0200
..oO(Tim Streater)
In article <ivgh64ll18rvnv95q6noc13cadab4r17uh@xxxxxxx>,
Michael Fesser <netizen@xxxxxx> wrote:
Pest or cholera. You also have to use a break to leave the while loop.
IMHO infinite loops are always ugly and bad coding style, regardless of
how you code them.
Not necessarily. I would always use while (true), as then you make
explicit what you are doing. Secondly, sure you have to break out of the
loop. But suppose there's a number of different reasons to do so? You're
not necessarily going to be able to choose one as the "main driver" of
the loop, which ought then to migrate into the loop construct?
You could still find a better way to express the loop condition, even if
it's just a variable:
while (!$workIsDone) {
...
}
I admit that I also use break/continue from time to time, but I try to
avoid them because they often lead to hard to understand spaghetti code.
There's almost always a better way to structure the code.
Micha
.
- Follow-Ups:
- Re: what does two semicolns ';;' do
- From: Tim Streater
- Re: what does two semicolns ';;' do
- From: sheldonlg
- Re: what does two semicolns ';;' do
- References:
- what does two semicolns ';;' do
- From: larry
- Re: what does two semicolns ';;' do
- From: AnrDaemon
- Re: what does two semicolns ';;' do
- From: Michael Fesser
- Re: what does two semicolns ';;' do
- From: Tim Streater
- what does two semicolns ';;' do
- Prev by Date: Re: what does two semicolns ';;' do
- Next by Date: Re: lookup funcion
- Previous by thread: Re: what does two semicolns ';;' do
- Next by thread: Re: what does two semicolns ';;' do
- Index(es):
Relevant Pages
|