Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

See, undefined behaviour is just that.. if you rely on it, you are submitting to surprises. Of course, your stance is a legit one, and I do think that cases like yours have to be considered; old code should not be broken lightheartedly, even if it was written with dirty practices. But I do not believe that this argument can outweigh significant reasons that favour a change.

I'm not saying that substr should be changed, rather than the current behaviour just becoming defined and documented. Whether there are any strong arguments in favour of a change in this specific instance is yet to be seen.

I do however feel that reliance on poorly documented or defined behaviour or even on outright bugs is too common a bad habit and anything that will teach people to refrain from it can only be a good thing in the long term.

After all, noone is forcing you to upgrade - Perl4, 5.0005_003 etc all still run fine. Old codebase does not have to be fixed right this instant.

I realize this is somewhat of an ivory tower opinion and that things in the realworld don't quite always work the way I would like them to. However, unless you begin somewhere and sometime, that's never going to change. And in Germany they say (roughly), a terrifying end is better than neverending terror.

In the end, I guess, it comes down to trying to find the best compromise. Legacy code should not hinder progress - but of course progress at all cost is no better either. Anyway, I think I'll quit this longwinded, meandering tangential post here before it goes much further.

____________
Makeshifts last the longest.

In reply to Re: A Bug in the Documentation or in Perl? by Aristotle
in thread [substr] anomaly or mine? by BrowserUk

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2024-04-25 15:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found