Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

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

Then perhaps you need to think about what "use 5.008;" actually does. First, it is a compile-time equivalent of "require 5.008" (use, especially in this case, is mostly just a compile-time version of require). Does your module "require 5.008"? You don't know. And yet you want to "clearly document" that your module requires 5.008?

If I have, for example, 5.6.1, what is the difference for me between you including "use 5.008" or not including it in your module? With "use 5.008", if I try to use your module I get told:

Perl v5.8.0 required--this is only v5.6.1

and things refuse to do anything else. How does that clearly document "I haven't tested this prior to 5.8" ? It doesn't. It simply prevents me from using your module as is. It "clearly documents" "This module is known to not work prior to 5.8, but as to why it doesn't work, we have nothing to say", which isn't very clear documentation.

Without "use 5.008", I'll get told something useful if you use some feature that wasn't present in my version of Perl, or I'll see one of your unit tests fail in the unlikely situation that you wrote code that compiles in my old version of Perl but does something different in it -- much attention is paid to making sure that valid Perl code doesn't break (do something different) when Perl is upgraded, after all.

What else does that imply? I means that any CPAN tester who does an automated test of your module will get a simple failure for versions of Perl prior to 5.8. So, if I wondered if your module worked on 5.6.1, I'd likely look at CPAN tester reports for 5.6.1 and your "use 5.008" prevents such tests from documenting anything about how your code would work in 5.6.1 except to document the fact that you included "use 5.008" in your source code.

So please stop doing that. If you want to document that you haven't tested prior to 5.8, say that in your documentation. Don't prevent prior versions of Perl from even having a chance to try to compile your code.

- tye        


In reply to Re^5: Huffman coding in pure Perl (why?) by tye
in thread Huffman coding in pure Perl by vrk

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 surveying the Monastery: (4)
As of 2024-03-29 12:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found