Hi,
actually so far my only comment on this thing was my ironical mail about removing try and catch because it is more or less the same as goto.
I think goto is quite similar. There have been no very compelling arguments in favor. Some of them don't hold because of break "n" and the few that are don't seem to be that strong of arguments.
I'm sorry but I just don't understand the great need for goto in PHP and that is coming from someone who does see the need in C.
The thing is? Where are the arguments agains goto? Actually I haven't read any valid argument sofar.
1) Uh Oh it is not OOP it is bad
That's not a valid argument.
2) Uh Oh it is evil, my university professor is saying that the whole day (it is most probably the same professor who believes that functional programming is bullshit and that the problems of the world can only be solved with slow OOP programs)
I'm afraid I disagree with you on this one. The university professor that taught me was an excellent C developer, and liked it a lot for what it's good at, even though he also liked OOP. The reasoning against using goto are simply because it breaks the fundamentals of structured programming, not OO programming, and it's no coincidence that so many different people around the world advise against using it, and that it's not being used in the vast majority of code, regardless whether it's OO or structured. It's just a generally-bad feature that is the wrong solution to almost all problems, which is another way of saying that code using it is likely to be of bad quality.
3) Uh Oh if I make a knot in my brain and use 10 stacked do/while break statements, that only a person with brain cancer can understand I can emulate the feature.
4) Uh Oh goto makes code ugly, people can abuse it and create spaghetti code. (I obviously do not know that OOP is creating even greater spaghetti code when used by people who have never heard about object design)
Goto (2) ;)
Zeev
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php