Reading code should not be like reading a detective book(which always need to be figured out)...
an example:
Java:
iterate_rows:
for (int i = 0; i < maxi; ++i)
{
for (int j = 0; j < maxj; ++j)
{
if (i == 4 < maxi && j == 3 < maxj)
break iterate_rows;
else
continue iterate_rows;
}
}
You don't need to figure out what break iterate_rows do, you just read it.
C++:
//iterate_rows:
for (int i = 0; i < maxi; ++i)
{
for (int j = 0; j < maxj; ++j)
{
if (i == 4 < maxi && j == 3 < maxj)
goto break_iterate_rows;
else
goto continue_iterate_rows;
}
continue_iterate_rows:;
}
break_iterate_rows:;
*goto break_iterate_rows* is just a visible version of break iterate_rows
If you confine your use of goto and labels on this kind of code only, you will not be figuring out the intent. Limiting your use of goto and labels on this kind of code will make you just read the code, not analyzing or figuring it out. You'll not be accused of being an evil programmer.
And if you really limit your gotos in this kind of code, you'll be able to develop a habit of not needing to figure out what those darn gotos do in your code. Added benefit is you don't have to introduce booleans and track them(which imho, leads you to detecting the code, making it a bit unreadable, which defeats the very purpose of avoiding gotos)
P.S.
Pair those labels with comments(before the loop), by the time you read past those lines with goto statement you already know the intent of those gotos