in reply to Re^2: Number of times I've used goto in Perl
in thread Number of times I've used goto in Perl
for, while, if, and more can also be implemented using a jump. That doesn't matter. The problem with goto isn't that it's a jump instruction; the problem is the resulting lack of code structure. For code to readable, it you should composed of "blocks". Prematures exits (next, last, return, die, and goto as used in my C example) are an exception as they can actually improve readability. This is why they don't necessarily have the same problem as goto.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Number of times I've used goto in Perl
by Anonymous Monk on May 07, 2018 at 09:04 UTC |