in reply to Re^6: Thread on Joel on software forum : "I hate Perl programmers."
in thread Thread on Joel on software forum : "I hate Perl programmers."

You keep mentioning over-use of $_ as a problem but I have to confess, I don't remember any time I was particurally stumped by the usage of $_ in an expression. Do you have any examples of complicated expressions where using $_ makes them harder to understand?
  • Comment on Re^7: Thread on Joel on software forum : "I hate Perl programmers."

Replies are listed 'Best First'.
Re^8: Thread on Joel on software forum : "I hate Perl programmers."
by perrin (Chancellor) on Jun 17, 2005 at 03:50 UTC
    Seriously? $_ is always harder to understand than a well-named variable.
      Um. Yes?
      for( @birds ) { next unless /bar/; s/puffin/poppin/; print; }
      Versus
      for $bird (@birds) { next unless $bird =~ /bar/; $bird =~ s/puffin/poppin/; print $bird; }
      Maybe it's me or my choice of code, but I don't really see the second one as being much harder to understand.
        No big deal -- we just diagree. I think the second is easier to read. Incidentally, you didn't explicitly use $_ here, just default function args. I find it more jarring when the $_ is explicit.