Slash Boxes
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.
More | Login | Reply
Loading... please wait.
  • An empty if-clause with a comment can serve to document your thought processes.

    if (is_mungo_sorted @items) {
        # The list is already in the order we need.
    else {
        # Need to sort them in bogological order.
        @items = rearrange @items;

    There's often a more elegant way to express things but an explicit do-nothing is sometimes the way I think about the problem, and it's good to have a way to comment that.

    BTW, why doesn't the comment box understand <pre>?

    -- Ed Avis
    • That's true. Shlomi Fish also expressed this point.

      I personally try not to write things like that because I get irritated seeing an empty if(). It feels like there should be something there and I (or whoever wrote it) has forgotten or hasn't implemented it. So, to me it adds to the confusion but I can see how other people find it useful and expressive. Perhaps there should be a comment that says # already ordered. do nothing.

      And yeah, I tried using h2, h3 and other stuff. These boxes don't get much...