I’ve used all of the C# Jump statements. You probably use break, continue, and return on a daily basis. And in your switch statements, you probably use default. But do you use the goto statement? If you are like me, you’ve been conditioned since QBasic to avoid the infamous goto statement. It creates spaghetti code, right? Well, if you use it irresponsibly, it does, but what about nested if statements? How do you jump out of 2 nested if statements? break and continue don’t work. My solution: Use the goto statement.
statement-that-should not happen if condition 2 is not met;
endIf:; //label to jump to and empty statement included.
You can probably think of several ways to refactor the above in order to avoid the goto statement, but in this case, the goto statement was the best decision, and this is a very valid use of the statement, and it does not create spaghetti code.