A very good - "political"- point! 8)

Anyway I didn't say that consistency is more important than functionality!

Let me explain .. if we're talking about rare edge cases any consistent output can be - from a higher point of view - a valid interpration.

An example, lets take a binary operator x which is used on two boole values A and B, such that

X 0 1 B - - 0|0 1 1|1 ? A

? denotes the edgecase of A=B=1 - in ikegamis words GI (=garbage input) - which produces inconsistent output, sometimes 0 sometimes 1, which causes many people to avoid this unpredictable operator.

Now surprisingly making it consistent is always a win. With ?=1 we get the OR operator, with ?=0 it's XOR!

Ok it's a simplified example, our case is more complicated, but I hope you get my point, why consistency is -technically - a win.

In our problem ?

Well it's the edge case of resetting pos. The result of the next match is inconsistent for an input of pos=undef and pos=0, which doesn't really make much sense.

So consistency is the first step on the way to kill bugs, your point is more about if improvements should be done step by step!

Cheers Rolf


In reply to Re^4: [bugs?] perldoc perlre, \G and pos() (why consistency counts) by LanX
in thread [bugs?] perldoc perlre, \G and pos() by LanX

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.