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();

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.

The word "now" would be much nicer to indicate a change if you made it
orthogonal to the "has".  So, use it as follows.

To assign a compile time property:
$a is now red;

To test a compile time property:
if ($a is red) {...}

To assign a runtime property:
$a now has green;
Who cares if the order is reversed.  Make it work both ways.

To test a runtime property:
if ($a has green) {...}

Me wrote:

> I agree 'but' seems a tad odd, and I like the elegance of your
> suggestion at first sight. However...
>
> > First, but is just strange.  I have a thing and I want to tell you it
> is
> > red, so I say 'but'.  Huh?
>
>     banana but red;
>     "foo" but false;
>
> According to Larry, run time properties will most often be used
> to contradict a built-in or compile time property. If he is right
> about the dominant case being a contradiction, 'but' works
> better for me than anything else I can think of, including 'now'
> (explained below).

Reply via email to