This item was added on: 2003/03/14
It seems that people place continue
near goto
when it comes to holy wars. The question stems from whether or not continue
falls into structured programming practice as well as whether a pure structured programming practice is practical in the real world.
while ( ( ch = getchar() ) != EOF )
{
if ( ch == ' ' )
{
}
}
while ( ( ch = getchar() ) != EOF )
{
if ( ch != ' ' )
continue;
}
By this train of thought, continue
is perfectly suited to structured programming. However, opinions are rarely swayed by rational thought. The best advice I have heard is that continue
is a tool and since there is no proof for whether its usage is correct or not, use it where it is needed and be prepared to be wrong in your decision. Credit: Prelude