Code:
while (!var)
{
//code
if (something)
{
var = 1;
}
}
{
//code
if (something)
{
var = 1;
}
}
or
Code:
while (1)
{
//code
if (something)
{
break;
}
}
They both do the same thing obviously, and I can use either one for part of my code so I was just wondering if one is prefered over the other. I would guess the first one is better since break seems to have the same reputation as goto. I've had a lot a similar situations while coding in the past; Is there a place where all these coding conventions are written out?