Cags
Contributor
I was just wondering if anything could be considered wrong with using the following...
Basically the functionality of the while is moved to a seperate function, am I likely to encounter any problem using this syntax, or would it be better todo...
As far as I can tell both these sections of code will perform the same, I just thought I'd put the question out incase theres something I'm missing. The last thing I wan't is for my application to start throwing random errors somewhere down the line.
C#:
while(MyFunction()) {}
C#:
bool isSuccess = true;
while(isSuccess)
{
isSuccess = MyFunction();
}