Sometimes I use something like:
private void Test()
{
success = false;
while (true)
{
if ( ! Action1() ) break;
if ( ! Action2() ) break;
if ( ! Action3() ) break;
if ( ! Action4() ) break;
if ( ! Action5() ) break;
success = true;
}
return success;
}
instead of a more "correct"
private void Test()
{
success = false;
if ( Action1() )
{
if ( Action2() )
{
if ( Action3() )
{
if ( Action4() )
{
if ( Action5() )
{
success = true;
}
}
}
}
}
return success;
}
than sometimes I feel guilty, but sometimes I this it's not so bad at all. Anyone would like to comment? Many thanks in advance, Max