Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

OTOH... ;)

I personally think the second of your examples really is more readable. But maybe I'm just a bit nuts.

Myself, I use as few temporary (synthetic) variables as possible, I think they often make things harder to understand. Even if I immediately get the idea what @chars is, I would glance back on every occurance of it, to make sure what your idea of "characters" really is (with or without underscore, hypen, etc.). If the code spreads out, things become even worse...

In your second example, it's right there.

Which brings us back to the topic of this thread. While I am sure that there are some style ideas, any good Perlmonk would propagate, some other things really are a matter of taste.

For example, my block statements look like this:

if($foo) { print $bar; }

A pattern I am quite sure most here don't use, even If they'd call it acceptable. Although I'm a developer for longer than I'd admit to an attractive young lady, ;) I still absorb other's styles from time to time. The monastery, CPAN and the like are good places for such inspiration. Just lately I saw a hash initialization like so:

my %hash = ( one => 1 , two => 2 , three => 3 );

A new pattern I didn't see before, but I liked and absorbed it instantly. It's unprobable to drop a comma on it, and optically, it's much nicer than my old style:

my %hash = ( one => 1, two => 2, three => 3 );

So, IMHO the bottom line is: Tastes are different. The important thing is, that you have style, wich one, matters less.

So long,
Flexx


In reply to Re^2: Tact and the Monastery by Flexx
in thread Tact and the Monastery by FoxtrotUniform

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (6)
    As of 2014-08-21 08:46 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (128 votes), past polls