On 2011-08-26 19:23, Brandon McCaig wrote:
Personally I think that it's easier to read without the labels. I think that any programmer that added an inner loop and didn't refactor the corresponding 'next', 'last', or 'redo' statement should be given up on. :P
Whenever you modify code you can potentially change the meaning. You need to understand the implications of that. Which is why small subroutines with limited scope are preferable to big, large, everything-is-global programs.
Personally I /rarely/ encounter nested loops with any 'next', 'last', or equivalent statements anywhere within. So I think that always using labels makes the majority of code more difficult to understand than the few cases where you do want to jump from an inner loop.
If you do find yourself writing code that is hard to follow then you probably need to modularize it more; _that's_ defensive programming. :)
Hear, hear. But to get properly read, use paragraphs, with a blank line in between. :)
-- Ruud -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/