Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • In one of his talks (Enterprise Perl?) James Duncan discussed readable code and gives the excellent advice that every loop should be a method. I find myself doing this more with Java than Perl, probably because I hit the mental ceiling for method length with Java's verbosity. So I'd typically translate your example to a method like:

    skipUnopenedTags(theStack);

    One side-effect of Java's not having unless is that I tend to write both 'isSomething' and 'isNotSomething' for readability, especially because an

    • I think that might be the case sometimes. I also think that there are people that just don't care. I've asked someone at work why they wrote this:
      my$x=$test>5?'foo':'bar';

      vs

      my $x = $test > 5 ? 'foo' : 'bar';

      And they literally didn't see the difference. It's quite depressing.

      -Dom