in reply to Re^3: The trap of reference numification
in thread The trap of reference numification

Comparisons are one thing, but I seriously doubt you do math ops on them (like in this case, using the modulus operator). If the warning recognized that situation, I suspect it would be pretty close to The Right Thing.

Caution: Contents may have been coded under pressure.
  • Comment on Re^4: The trap of reference numification

Replies are listed 'Best First'.
Re^5: The trap of reference numification
by dragonchild (Archbishop) on Nov 11, 2005 at 23:04 UTC
    So, you're proposing that the warning should warn whenever a reference is numified, save when the numified value is used in a == (any other exceptions)? Talk about a weird exception to a weird case. And you think we get laughed out now ...

    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
      At issue is determining when something is likely to be programmer error. That's a very twisty problem. Your post suggests that you think it should be straightforward and elegant. Whose laughter are you concerned about?

      Do you disagree with my suggestion, and if so, have you got some stronger argument than ridicule?


      Caution: Contents may have been coded under pressure.
        The correct fix is to have references throw an error when numified or stringified. Period, end of story. If you want to stringify a reference, use ref(). If you want to numify a reference, use ref_addr(). If you want something unique, use some combination of the two.

        Solve the problem. Don't throw a random bandaid on it.


        My criteria for good software:
        1. Does it work?
        2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?