On Sat, 20 Apr 2002, Daniel S. Wilkerson wrote:
> Everyone I've ever talked to about it agrees that defining things to be a
> negative is just a bad idea. Consider:
>
> if (gronk) do_this();
> else do_that();
>
> versus
>
> if (not_gronk) do_that();
> else do_this();
But look how well C<unless> reads :) IMO, C<unless> is one of the best
readability decisions that Perl ever made.
> It is one of the standard refactoring tricks to replace the second one
> with the first. The word "has" is in the positive, whereas "but" is a
> negative, but it assigns a positive, even more confusing.
You wouldn't expect
$foobar but true
to actually be false, would you? So, I wouldn't say assigning a positive
is all that confusing.
> To assign a compile time property:
> $a is now red;
That uses too many of my precious keystrokes.
> To test a runtime property:
> if ($a has green) {...}
This brings up an interesting point.
if ($a but green) {...}
doesn't make a lot of sense. Would it be possible to make boolean C<is>
test both runtime and compile-time properties? But I suppose that could
be confusing on the reader....
Luke