I know this might be a bit of a 'silly' question, but sometimes, I just want to loop until a condition is false but I don't like keeping the loop empty. So instead of:
Visible = true;
while(IsRunning)
{
}
Visible = false;
I usually prefer:
while(IsRunning)
{
Visible = true;
}
Visible = false;
However, I'm a bit concerned about what exactly happens at the line Visible = true;
. Does the Runtime keep executing that statement even though it's redundant? Is it even advisable to do it this way? Many 'code-enhancements' plugins don't like empty while loops, and I don't really understand why.
SO:
Is there anything wrong with having an empty while loop?
Does having a loop such as shown above have any performance effects?
Thanks!