Stanislav Malyshev wrote:
LS>>a scope limited goto will never be close as dangerous for spagetti LS>>code as exceptions already are because they are not scope limited.

Exceptions are structured way of handling code flow - you can not get to random points of code with exception, you can get either to enclosing catch or stop the program entirely. Unlike exceptions, goto allows to jump to a random point of code. I don't know what do you mean by "limited" - I see that the consensus among the goto proponents is to not impose any limits on the place you could jump to - because, of course, once you strated to jump around you always can find a use for jumping to any place, if you are creative enough - and I do not doubt creativity of PHP people.

Well I do not follow the noise on internals quite as avid as some other people, so I might have missed a real signal on this topic. But from discussions over the past months it seemed to me that the "goto all the way" camp was fine with limiting jumping to the current scope (function/method) which makes it much more obvious compared to exceptions in my book.

The question now is just if we want to limit this even further by only allowing forward jumps or not.

Eitherway its quite obvious that labeled breaks in loops are much easier to read over "break 3" kinda stuff we require now. So even such a limited "goto" aka "labeled break" construct is obviously needed quite dearly and doesnt really add anything but clarity to the current syntax options we already have.

regards,
Lukas

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to