On Wed, Aug 24, 2011 at 6:07 PM, Rob Dixon <rob.di...@gmx.com> wrote: > On 22/08/2011 10:29, Shlomi Fish wrote: > Just as with pronouns in natural language, implicit operands in Perl > allow the meaning of a program to be more lucid. Yes, if we are not > careful we can sometimes write confusing English where it is unclear > what 'it' or 'he' refers to, but the solution is always to restructure > the sentence rather than simply use proper nouns everywhere. > > Shlomi, do you honestly give a label to every last, next etc. that you > write in live code?
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. :) -- Brandon McCaig <http://www.bamccaig.com/> <bamcc...@gmail.com> V zrna gur orfg jvgu jung V fnl. Vg qbrfa'g nyjnlf fbhaq gung jnl. Castopulence Software <http://www.castopulence.org/> <bamcc...@castopulence.org> -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/