I've actually heard quite a bit of GOTO bashing recently (specifically re: PHP). And I'll admit it shouldn't be the first choice of programming tools. But the majority of arguments are pithy lines about it being a last resort or ugly - but not why it is a bad move functionally, programmatically, or even in terms of maintainability (ok, this last one does come up).

There is a good conversation from a while back on StackOverflow (http://stackoverflow.com/questions/1900017/is-goto-in-php-evil), and I think the best answer, which was not chosen said it well with:

"Bad structuring of code is evil, regardless the control structure you use.

I personally prefer a goto that makes clear the flow of the program to "control variables" and nested "if" that will indirectly just cause the same branch in the code."

Basically, don't abuse it and don't write bad code. The same could be said for nested ifs, breaks in whiles, or recursive structures. They all have their places, but misuse can lead to unreadable, unmaintainable code.

But maybe I'm just stirring a hornets nest for no good reason.
Shared publiclyView activity