4 ms·
Not all useful control flow graphs can be described with while and if. It's perfectly fine to use goto. Look at some of the contortions people need to go throug
by quotemstr 12y ago
Not all useful control flow graphs can be described with while and if. It's perfectly fine to use goto. Look at some of the contortions people need to go through when avoiding it. Avoiding goto often makes programs harder to follow.
Why is it inexperienced programmers go through a phase where they think goto is evil incarnate? I wish Dijkstra had never written that damn paper.
- wyager 12y ago>Not all useful control flow graphs can be described with while and if. They can be described with if, while, for, case, pattern matching, recursion, etc. There is almost always a better alternative. >Why is it inexperienced programmers go through a phase where they think goto is evil incarnate? It seems to me that most people who support general usage of GOTO are inexperienced and don't necessarily realize it. They lack knowledge of better control structures. See the blub paradox. Besides, the justification here is performance, not readability. I'm saying that performance in particular is a bad justification for using GOTO.
- jtc331 12y agoAgreed that sometimes it's right for control-flow purposes. Hence why I pointed out in the OP thread that I've used it before. But that's not the justification being used by the code author; his justification is purely performance. >> "Why is it inexperienced programmers go through a phase where they think goto is evil incarnate? I wish Dijkstra had never written that damn paper." You seem to be referencing my comments. I'm not inexperienced, and I don't think goto is evil incarnate. I do believe that optimizing for individual CPU cycles in PHP is generally pointless.