in reply to Re^4: OO Perl: Nested classes question
in thread OO Perl: Nested classes question

Note that I never specifically gave advice about if versus unless (not intentionally anyway)

Silly as it may seem, I've always assumed unless could only be used as a post-condition.

That being said... even now that you've shown me, I'll probably still keep on using just if, for a few reasons:

Replies are listed 'Best First'.
Re^6: OO Perl: Nested classes question
by tilly (Archbishop) on Sep 16, 2006 at 03:45 UTC
    For me ! is not a useful visual tool at all. The rest sounds very reasonable.

    Allow me to add to the list the observation that humans don't do a good job of doing De Morgan's Laws in practice. When you're writing it, it is easy to make the statement mean what you want it to mean. But when you are tracing through code later, it is surprisingly difficult to figure out whether you enter a condition that reads unless (A or B) {...}

    And yeah, when I was first told that I thought it was nonsense. It was not until I was having trouble debugging something at 11 PM that I realized it was true. Therefore I use unless very, very sparingly.