Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

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

It all depends on the kind of code, and the intended audience. For CPAN modules, I try to optimize for performance if it doesn't hurt readability too much. This code can be understood by experienced Perl programmers.

For one-off quick hacks and oneliners, I don't care about readability and will use any technique that saves me from having to write much more code. This code can often be understood by people who are experienced in Perl. I will use ~~ instead of scalar.

For example code in documentation, I try to optimize for readability. However, I will continue to assume that the reader is at least comfortable with Perl. That means that I still do use statement modifiers and the $_ variable.

The Perl novice will have to find a way to plough through the first part of learning Perl: dealing with its sometimes exotic syntax. In some ways that is a barrier of entry, and keeps dumb and uninterested people away. It's not hard to learn how Perl works, there's lot of documentation to explain it. If you're learning Perl, you're only a real novice for a few days anyway.

I suggest that people who are not comfortable with Perl, should not be using it.

Juerd # { site => 'juerd.nl', do_not_use => 'spamtrap', perl6_server => 'feather' }


In reply to Re: My Perl code can be understood by... by Juerd
in thread My Perl code can be understood by... by TimButterfield

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 about the Monastery: (5)
As of 2024-03-28 16:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found